diff options
| author | Tom Tromey | 2012-08-19 03:23:03 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-19 03:23:03 -0600 |
| commit | 5651640d578fa2efa40be4789d9fa61813ccb1fa (patch) | |
| tree | a59e33464016e88cb3f0501d6c47baf8aa5e07aa /src/data.c | |
| parent | ee1464eab19311ab7708b135bdb6eb989909e4cc (diff) | |
| download | emacs-5651640d578fa2efa40be4789d9fa61813ccb1fa.tar.gz emacs-5651640d578fa2efa40be4789d9fa61813ccb1fa.zip | |
condition variables
This implements condition variables for elisp.
This needs more tests.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c index b47c2d12aff..e6342caadf1 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -94,7 +94,7 @@ static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; | |||
| 94 | static Lisp_Object Qsubrp, Qmany, Qunevalled; | 94 | static Lisp_Object Qsubrp, Qmany, Qunevalled; |
| 95 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; | 95 | Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; |
| 96 | static Lisp_Object Qdefun; | 96 | static Lisp_Object Qdefun; |
| 97 | Lisp_Object Qthread, Qmutex; | 97 | Lisp_Object Qthread, Qmutex, Qcondition_variable; |
| 98 | 98 | ||
| 99 | Lisp_Object Qinteractive_form; | 99 | Lisp_Object Qinteractive_form; |
| 100 | 100 | ||
| @@ -216,6 +216,8 @@ for example, (type-of 1) returns `integer'. */) | |||
| 216 | return Qthread; | 216 | return Qthread; |
| 217 | if (MUTEXP (object)) | 217 | if (MUTEXP (object)) |
| 218 | return Qmutex; | 218 | return Qmutex; |
| 219 | if (CONDVARP (object)) | ||
| 220 | return Qcondition_variable; | ||
| 219 | return Qvector; | 221 | return Qvector; |
| 220 | 222 | ||
| 221 | case Lisp_Float: | 223 | case Lisp_Float: |
| @@ -482,6 +484,17 @@ DEFUN ("mutexp", Fmutexp, Smutexp, 1, 1, 0, | |||
| 482 | else | 484 | else |
| 483 | return Qnil; | 485 | return Qnil; |
| 484 | } | 486 | } |
| 487 | |||
| 488 | DEFUN ("condition-variablep", Fcondition_variablep, Scondition_variablep, | ||
| 489 | 1, 1, 0, | ||
| 490 | doc: /* Return t if OBJECT is a condition variable. */) | ||
| 491 | (Lisp_Object object) | ||
| 492 | { | ||
| 493 | if (CONDVARP (object)) | ||
| 494 | return Qt; | ||
| 495 | else | ||
| 496 | return Qnil; | ||
| 497 | } | ||
| 485 | 498 | ||
| 486 | /* Extract and set components of lists */ | 499 | /* Extract and set components of lists */ |
| 487 | 500 | ||
| @@ -3117,6 +3130,7 @@ syms_of_data (void) | |||
| 3117 | DEFSYM (Qhash_table, "hash-table"); | 3130 | DEFSYM (Qhash_table, "hash-table"); |
| 3118 | DEFSYM (Qthread, "thread"); | 3131 | DEFSYM (Qthread, "thread"); |
| 3119 | DEFSYM (Qmutex, "mutex"); | 3132 | DEFSYM (Qmutex, "mutex"); |
| 3133 | DEFSYM (Qcondition_variable, "condition-variable"); | ||
| 3120 | /* Used by Fgarbage_collect. */ | 3134 | /* Used by Fgarbage_collect. */ |
| 3121 | DEFSYM (Qinterval, "interval"); | 3135 | DEFSYM (Qinterval, "interval"); |
| 3122 | DEFSYM (Qmisc, "misc"); | 3136 | DEFSYM (Qmisc, "misc"); |
| @@ -3161,6 +3175,7 @@ syms_of_data (void) | |||
| 3161 | defsubr (&Schar_or_string_p); | 3175 | defsubr (&Schar_or_string_p); |
| 3162 | defsubr (&Sthreadp); | 3176 | defsubr (&Sthreadp); |
| 3163 | defsubr (&Smutexp); | 3177 | defsubr (&Smutexp); |
| 3178 | defsubr (&Scondition_variablep); | ||
| 3164 | defsubr (&Scar); | 3179 | defsubr (&Scar); |
| 3165 | defsubr (&Scdr); | 3180 | defsubr (&Scdr); |
| 3166 | defsubr (&Scar_safe); | 3181 | defsubr (&Scar_safe); |