aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Albinus2018-08-31 10:47:03 +0200
committerMichael Albinus2018-08-31 10:47:03 +0200
commitac7936cb8f4d4d6706535bfcea0d97741c2ca15f (patch)
tree3399f9b5994fda2d8d6254985032803bf5958700 /src
parent3d09d533d15eae2974f3858df43746cf6e8f897b (diff)
downloademacs-ac7936cb8f4d4d6706535bfcea0d97741c2ca15f.tar.gz
emacs-ac7936cb8f4d4d6706535bfcea0d97741c2ca15f.zip
Rename thread-alive-p to thread-live-p
* doc/lispref/threads.texi (Basic Thread Functions): Use thread-live-p. * etc/NEWS: 'thread-alive-p' has been renamed to 'thread-live-p'. * src/thread.c (thread_live_p): Rename from thread_alive_p. Adapt all callees. (Fthread_live_p): Rename from Fthread_alive_p. (syms_of_threads): Make thread-alive-p an alias of thread-live-p. * test/src/thread-tests.el (all): Replace `thread-alive-p' by `thread-live-p'. (threads-live): Rename from `threads-alive'.
Diffstat (limited to 'src')
-rw-r--r--src/thread.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/thread.c b/src/thread.c
index 04c2808e5c4..9b450ee0a45 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -41,7 +41,7 @@ extern volatile int interrupt_input_blocked;
41 41
42/* m_specpdl is set when the thread is created and cleared when the 42/* m_specpdl is set when the thread is created and cleared when the
43 thread dies. */ 43 thread dies. */
44#define thread_alive_p(STATE) ((STATE)->m_specpdl != NULL) 44#define thread_live_p(STATE) ((STATE)->m_specpdl != NULL)
45 45
46 46
47 47
@@ -884,7 +884,7 @@ or `thread-join' in the target thread. */)
884 return Qnil; 884 return Qnil;
885} 885}
886 886
887DEFUN ("thread-alive-p", Fthread_alive_p, Sthread_alive_p, 1, 1, 0, 887DEFUN ("thread-live-p", Fthread_live_p, Sthread_live_p, 1, 1, 0,
888 doc: /* Return t if THREAD is alive, or nil if it has exited. */) 888 doc: /* Return t if THREAD is alive, or nil if it has exited. */)
889 (Lisp_Object thread) 889 (Lisp_Object thread)
890{ 890{
@@ -893,7 +893,7 @@ DEFUN ("thread-alive-p", Fthread_alive_p, Sthread_alive_p, 1, 1, 0,
893 CHECK_THREAD (thread); 893 CHECK_THREAD (thread);
894 tstate = XTHREAD (thread); 894 tstate = XTHREAD (thread);
895 895
896 return thread_alive_p (tstate) ? Qt : Qnil; 896 return thread_live_p (tstate) ? Qt : Qnil;
897} 897}
898 898
899DEFUN ("thread--blocker", Fthread_blocker, Sthread_blocker, 1, 1, 0, 899DEFUN ("thread--blocker", Fthread_blocker, Sthread_blocker, 1, 1, 0,
@@ -923,7 +923,7 @@ thread_join_callback (void *arg)
923 XSETTHREAD (thread, tstate); 923 XSETTHREAD (thread, tstate);
924 self->event_object = thread; 924 self->event_object = thread;
925 self->wait_condvar = &tstate->thread_condvar; 925 self->wait_condvar = &tstate->thread_condvar;
926 while (thread_alive_p (tstate) && NILP (self->error_symbol)) 926 while (thread_live_p (tstate) && NILP (self->error_symbol))
927 sys_cond_wait (self->wait_condvar, &global_lock); 927 sys_cond_wait (self->wait_condvar, &global_lock);
928 928
929 self->wait_condvar = NULL; 929 self->wait_condvar = NULL;
@@ -946,7 +946,7 @@ It is an error for a thread to try to join itself. */)
946 if (tstate == current_thread) 946 if (tstate == current_thread)
947 error ("Cannot join current thread"); 947 error ("Cannot join current thread");
948 948
949 if (thread_alive_p (tstate)) 949 if (thread_live_p (tstate))
950 flush_stack_call_func (thread_join_callback, tstate); 950 flush_stack_call_func (thread_join_callback, tstate);
951 951
952 return Qnil; 952 return Qnil;
@@ -961,7 +961,7 @@ DEFUN ("all-threads", Fall_threads, Sall_threads, 0, 0, 0,
961 961
962 for (iter = all_threads; iter; iter = iter->next_thread) 962 for (iter = all_threads; iter; iter = iter->next_thread)
963 { 963 {
964 if (thread_alive_p (iter)) 964 if (thread_live_p (iter))
965 { 965 {
966 Lisp_Object thread; 966 Lisp_Object thread;
967 967
@@ -1051,7 +1051,7 @@ syms_of_threads (void)
1051 defsubr (&Scurrent_thread); 1051 defsubr (&Scurrent_thread);
1052 defsubr (&Sthread_name); 1052 defsubr (&Sthread_name);
1053 defsubr (&Sthread_signal); 1053 defsubr (&Sthread_signal);
1054 defsubr (&Sthread_alive_p); 1054 defsubr (&Sthread_live_p);
1055 defsubr (&Sthread_join); 1055 defsubr (&Sthread_join);
1056 defsubr (&Sthread_blocker); 1056 defsubr (&Sthread_blocker);
1057 defsubr (&Sall_threads); 1057 defsubr (&Sall_threads);
@@ -1069,6 +1069,9 @@ syms_of_threads (void)
1069 staticpro (&last_thread_error); 1069 staticpro (&last_thread_error);
1070 last_thread_error = Qnil; 1070 last_thread_error = Qnil;
1071 1071
1072 Fdefalias (intern_c_string ("thread-alive-p"),
1073 intern_c_string ("thread-live-p"), Qnil);
1074
1072 Fprovide (intern_c_string ("threads"), Qnil); 1075 Fprovide (intern_c_string ("threads"), Qnil);
1073 } 1076 }
1074 1077