summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-08-19 03:31:57 -0600
committerTom Tromey <tromey@redhat.com>2012-08-19 03:31:57 -0600
commit1fb339bccd65db50adc2ad7f7290099808fc439d (patch)
tree90cc4f1b9b4bf17f09031320825267232fa43143 /src/thread.c
parent9dad5e59e30c1b0d1047838048510f59552be492 (diff)
downloademacs-1fb339bccd65db50adc2ad7f7290099808fc439d.tar.gz
emacs-1fb339bccd65db50adc2ad7f7290099808fc439d.tar.bz2
emacs-1fb339bccd65db50adc2ad7f7290099808fc439d.zip
add condition-mutex and condition-name
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. */)
return Qnil;
}
+DEFUN ("condition-mutex", Fcondition_mutex, Scondition_mutex, 1, 1, 0,
+ doc: /* Return the mutex associated with CONDITION. */)
+ (Lisp_Object condition)
+{
+ struct Lisp_CondVar *cvar;
+
+ CHECK_CONDVAR (condition);
+ cvar = XCONDVAR (condition);
+
+ return cvar->mutex;
+}
+
+DEFUN ("condition-name", Fcondition_name, Scondition_name, 1, 1, 0,
+ doc: /* Return the name of CONDITION.
+If no name was given when CONDITION was created, return nil. */)
+ (Lisp_Object condition)
+{
+ struct Lisp_CondVar *cvar;
+
+ CHECK_CONDVAR (condition);
+ cvar = XCONDVAR (condition);
+
+ return cvar->name;
+}
+
void
finalize_one_condvar (struct Lisp_CondVar *condvar)
{
@@ -898,6 +923,8 @@ syms_of_threads (void)
defsubr (&Smake_condition_variable);
defsubr (&Scondition_wait);
defsubr (&Scondition_notify);
+ defsubr (&Scondition_mutex);
+ defsubr (&Scondition_name);
Qthreadp = intern_c_string ("threadp");
staticpro (&Qthreadp);