diff options
| author | Tom Tromey | 2012-08-19 03:31:57 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-19 03:31:57 -0600 |
| commit | 1fb339bccd65db50adc2ad7f7290099808fc439d (patch) | |
| tree | 90cc4f1b9b4bf17f09031320825267232fa43143 /src/thread.c | |
| parent | 9dad5e59e30c1b0d1047838048510f59552be492 (diff) | |
| download | emacs-1fb339bccd65db50adc2ad7f7290099808fc439d.tar.gz emacs-1fb339bccd65db50adc2ad7f7290099808fc439d.zip | |
add condition-mutex and condition-name
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 27 |
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 | ||
| 428 | DEFUN ("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 | |||
| 440 | DEFUN ("condition-name", Fcondition_name, Scondition_name, 1, 1, 0, | ||
| 441 | doc: /* Return the name of CONDITION. | ||
| 442 | If 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 | |||
| 428 | void | 453 | void |
| 429 | finalize_one_condvar (struct Lisp_CondVar *condvar) | 454 | finalize_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); |