aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorMichael Albinus2018-08-31 11:15:48 +0200
committerMichael Albinus2018-08-31 11:15:48 +0200
commit6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e (patch)
tree32ea1de28e6303b14a007c8d9e28e57dfbc0066e /src/thread.c
parentdb2fed3bdfb351c3283e481829ce687931d27a3d (diff)
parentac7936cb8f4d4d6706535bfcea0d97741c2ca15f (diff)
downloademacs-6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e.tar.gz
emacs-6f3cf12e4fb6c810ebf37c8819dc2ee39b02199e.zip
Merge from origin/emacs-26
ac7936cb8f Rename thread-alive-p to thread-live-p 3d09d533d1 rcirc: Document /reconnect as a built-in command (Bug#29656) a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test.
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/thread.c b/src/thread.c
index 081569f8a38..fc933440fcc 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
@@ -904,7 +904,7 @@ If THREAD is the main thread, just the error message is shown. */)
904 return Qnil; 904 return Qnil;
905} 905}
906 906
907DEFUN ("thread-alive-p", Fthread_alive_p, Sthread_alive_p, 1, 1, 0, 907DEFUN ("thread-live-p", Fthread_live_p, Sthread_live_p, 1, 1, 0,
908 doc: /* Return t if THREAD is alive, or nil if it has exited. */) 908 doc: /* Return t if THREAD is alive, or nil if it has exited. */)
909 (Lisp_Object thread) 909 (Lisp_Object thread)
910{ 910{
@@ -913,7 +913,7 @@ DEFUN ("thread-alive-p", Fthread_alive_p, Sthread_alive_p, 1, 1, 0,
913 CHECK_THREAD (thread); 913 CHECK_THREAD (thread);
914 tstate = XTHREAD (thread); 914 tstate = XTHREAD (thread);
915 915
916 return thread_alive_p (tstate) ? Qt : Qnil; 916 return thread_live_p (tstate) ? Qt : Qnil;
917} 917}
918 918
919DEFUN ("thread--blocker", Fthread_blocker, Sthread_blocker, 1, 1, 0, 919DEFUN ("thread--blocker", Fthread_blocker, Sthread_blocker, 1, 1, 0,
@@ -943,7 +943,7 @@ thread_join_callback (void *arg)
943 XSETTHREAD (thread, tstate); 943 XSETTHREAD (thread, tstate);
944 self->event_object = thread; 944 self->event_object = thread;
945 self->wait_condvar = &tstate->thread_condvar; 945 self->wait_condvar = &tstate->thread_condvar;
946 while (thread_alive_p (tstate) && NILP (self->error_symbol)) 946 while (thread_live_p (tstate) && NILP (self->error_symbol))
947 sys_cond_wait (self->wait_condvar, &global_lock); 947 sys_cond_wait (self->wait_condvar, &global_lock);
948 948
949 self->wait_condvar = NULL; 949 self->wait_condvar = NULL;
@@ -970,7 +970,7 @@ is an error for a thread to try to join itself. */)
970 error_symbol = tstate->error_symbol; 970 error_symbol = tstate->error_symbol;
971 error_data = tstate->error_data; 971 error_data = tstate->error_data;
972 972
973 if (thread_alive_p (tstate)) 973 if (thread_live_p (tstate))
974 flush_stack_call_func (thread_join_callback, tstate); 974 flush_stack_call_func (thread_join_callback, tstate);
975 975
976 if (!NILP (error_symbol)) 976 if (!NILP (error_symbol))
@@ -988,7 +988,7 @@ DEFUN ("all-threads", Fall_threads, Sall_threads, 0, 0, 0,
988 988
989 for (iter = all_threads; iter; iter = iter->next_thread) 989 for (iter = all_threads; iter; iter = iter->next_thread)
990 { 990 {
991 if (thread_alive_p (iter)) 991 if (thread_live_p (iter))
992 { 992 {
993 Lisp_Object thread; 993 Lisp_Object thread;
994 994
@@ -1093,7 +1093,7 @@ syms_of_threads (void)
1093 defsubr (&Scurrent_thread); 1093 defsubr (&Scurrent_thread);
1094 defsubr (&Sthread_name); 1094 defsubr (&Sthread_name);
1095 defsubr (&Sthread_signal); 1095 defsubr (&Sthread_signal);
1096 defsubr (&Sthread_alive_p); 1096 defsubr (&Sthread_live_p);
1097 defsubr (&Sthread_join); 1097 defsubr (&Sthread_join);
1098 defsubr (&Sthread_blocker); 1098 defsubr (&Sthread_blocker);
1099 defsubr (&Sall_threads); 1099 defsubr (&Sall_threads);
@@ -1111,6 +1111,9 @@ syms_of_threads (void)
1111 staticpro (&last_thread_error); 1111 staticpro (&last_thread_error);
1112 last_thread_error = Qnil; 1112 last_thread_error = Qnil;
1113 1113
1114 Fdefalias (intern_c_string ("thread-alive-p"),
1115 intern_c_string ("thread-live-p"), Qnil);
1116
1114 Fprovide (intern_c_string ("threads"), Qnil); 1117 Fprovide (intern_c_string ("threads"), Qnil);
1115 } 1118 }
1116 1119