aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c
index b8ffb0662c3..4c21418d1c3 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -425,6 +425,31 @@ thread. */)
425 return Qnil; 425 return Qnil;
426} 426}
427 427
428DEFUN ("condition-mutex", Fcondition_mutex, Scondition_mutex, 1, 1, 0,
429 doc: /* Return the mutex associated with CONDITION. */)
430 (Lisp_Object condition)
431{
432 struct Lisp_CondVar *cvar;
433
434 CHECK_CONDVAR (condition);
435 cvar = XCONDVAR (condition);
436
437 return cvar->mutex;
438}
439
440DEFUN ("condition-name", Fcondition_name, Scondition_name, 1, 1, 0,
441 doc: /* Return the name of CONDITION.
442If no name was given when CONDITION was created, return nil. */)
443 (Lisp_Object condition)
444{
445 struct Lisp_CondVar *cvar;
446
447 CHECK_CONDVAR (condition);
448 cvar = XCONDVAR (condition);
449
450 return cvar->name;
451}
452
428void 453void
429finalize_one_condvar (struct Lisp_CondVar *condvar) 454finalize_one_condvar (struct Lisp_CondVar *condvar)
430{ 455{
@@ -898,6 +923,8 @@ syms_of_threads (void)
898 defsubr (&Smake_condition_variable); 923 defsubr (&Smake_condition_variable);
899 defsubr (&Scondition_wait); 924 defsubr (&Scondition_wait);
900 defsubr (&Scondition_notify); 925 defsubr (&Scondition_notify);
926 defsubr (&Scondition_mutex);
927 defsubr (&Scondition_name);
901 928
902 Qthreadp = intern_c_string ("threadp"); 929 Qthreadp = intern_c_string ("threadp");
903 staticpro (&Qthreadp); 930 staticpro (&Qthreadp);