summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index 9f4bd1f1c02..95cbd471d33 100644
--- a/src/data.c
+++ b/src/data.c
@@ -80,6 +80,7 @@ static Lisp_Object Qsubrp;
static Lisp_Object Qmany, Qunevalled;
Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
static Lisp_Object Qdefun;
+Lisp_Object Qthread, Qmutex, Qcondition_variable;
Lisp_Object Qinteractive_form;
static Lisp_Object Qdefalias_fset_function;
@@ -286,6 +287,12 @@ for example, (type-of 1) returns `integer'. */)
return Qfont_entity;
if (FONT_OBJECT_P (object))
return Qfont_object;
+ if (THREADP (object))
+ return Qthread;
+ if (MUTEXP (object))
+ return Qmutex;
+ if (CONDVARP (object))
+ return Qcondition_variable;
return Qvector;
case Lisp_Float:
@@ -534,6 +541,36 @@ DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
return Qnil;
}
+DEFUN ("threadp", Fthreadp, Sthreadp, 1, 1, 0,
+ doc: /* Return t if OBJECT is a thread. */)
+ (Lisp_Object object)
+{
+ if (THREADP (object))
+ return Qt;
+ else
+ return Qnil;
+}
+
+DEFUN ("mutexp", Fmutexp, Smutexp, 1, 1, 0,
+ doc: /* Return t if OBJECT is a mutex. */)
+ (Lisp_Object object)
+{
+ if (MUTEXP (object))
+ return Qt;
+ else
+ return Qnil;
+}
+
+DEFUN ("condition-variable-p", Fcondition_variable_p, Scondition_variable_p,
+ 1, 1, 0,
+ doc: /* Return t if OBJECT is a condition variable. */)
+ (Lisp_Object object)
+{
+ if (CONDVARP (object))
+ return Qt;
+ else
+ return Qnil;
+}
/* Extract and set components of lists. */
@@ -3101,6 +3138,9 @@ syms_of_data (void)
DEFSYM (Qchar_table, "char-table");
DEFSYM (Qbool_vector, "bool-vector");
DEFSYM (Qhash_table, "hash-table");
+ DEFSYM (Qthread, "thread");
+ DEFSYM (Qmutex, "mutex");
+ DEFSYM (Qcondition_variable, "condition-variable");
DEFSYM (Qmisc, "misc");
DEFSYM (Qdefun, "defun");
@@ -3142,6 +3182,9 @@ syms_of_data (void)
defsubr (&Ssubrp);
defsubr (&Sbyte_code_function_p);
defsubr (&Schar_or_string_p);
+ defsubr (&Sthreadp);
+ defsubr (&Smutexp);
+ defsubr (&Scondition_variable_p);
defsubr (&Scar);
defsubr (&Scdr);
defsubr (&Scar_safe);