aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/thread.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/thread.c b/src/thread.c
index 3eba25b7b43..754d286e9f8 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -973,11 +973,17 @@ DEFUN ("all-threads", Fall_threads, Sall_threads, 0, 0, 0,
973 return result; 973 return result;
974} 974}
975 975
976DEFUN ("thread-last-error", Fthread_last_error, Sthread_last_error, 0, 0, 0, 976DEFUN ("thread-last-error", Fthread_last_error, Sthread_last_error, 0, 1, 0,
977 doc: /* Return the last error form recorded by a dying thread. */) 977 doc: /* Return the last error form recorded by a dying thread.
978 (void) 978If CLEANUP is non-nil, remove this error form from history. */)
979 (Lisp_Object cleanup)
979{ 980{
980 return last_thread_error; 981 Lisp_Object result = last_thread_error;
982
983 if (!NILP (cleanup))
984 last_thread_error = Qnil;
985
986 return result;
981} 987}
982 988
983 989
@@ -1083,4 +1089,13 @@ syms_of_threads (void)
1083 DEFSYM (Qthreadp, "threadp"); 1089 DEFSYM (Qthreadp, "threadp");
1084 DEFSYM (Qmutexp, "mutexp"); 1090 DEFSYM (Qmutexp, "mutexp");
1085 DEFSYM (Qcondition_variable_p, "condition-variable-p"); 1091 DEFSYM (Qcondition_variable_p, "condition-variable-p");
1092
1093 DEFVAR_LISP ("main-thread",
1094 Vmain_thread,
1095 doc: /* The main thread of Emacs. */);
1096#ifdef THREADS_ENABLED
1097 XSETTHREAD (Vmain_thread, &main_thread);
1098#else
1099 Vmain_thread = Qnil;
1100#endif
1086} 1101}