diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 17 |
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 | ||
| 907 | DEFUN ("thread-alive-p", Fthread_alive_p, Sthread_alive_p, 1, 1, 0, | 907 | DEFUN ("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 | ||
| 919 | DEFUN ("thread--blocker", Fthread_blocker, Sthread_blocker, 1, 1, 0, | 919 | DEFUN ("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 | ||