summaryrefslogtreecommitdiff
path: root/src/systhread.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-08-26 08:46:30 -0600
committerTom Tromey <tromey@redhat.com>2013-08-26 08:46:30 -0600
commit2ee7755c8d35aba1d598c9baa910bd5af228f095 (patch)
tree0eb4817057fef64fb07767f8b025b4d47fb80cb6 /src/systhread.h
parent793ea5055aea85ff9227e1bf0c84ab37edba7201 (diff)
downloademacs-2ee7755c8d35aba1d598c9baa910bd5af228f095.tar.gz
implement --enable-threads and a thread-less mode
Diffstat (limited to 'src/systhread.h')
-rw-r--r--src/systhread.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/systhread.h b/src/systhread.h
index bbd242ab93c..eb9cde78b61 100644
--- a/src/systhread.h
+++ b/src/systhread.h
@@ -1,5 +1,5 @@
/* System thread definitions
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012, 2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -19,6 +19,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SYSTHREAD_H
#define SYSTHREAD_H
+#ifdef THREADS_ENABLED
+
#ifdef HAVE_PTHREAD
#include <pthread.h>
@@ -32,11 +34,20 @@ typedef pthread_cond_t sys_cond_t;
/* A system thread. */
typedef pthread_t sys_thread_t;
-#else
+#else /* HAVE_PTHREAD */
#error port me
-#endif
+#endif /* HAVE_PTHREAD */
+
+#else /* THREADS_ENABLED */
+
+/* For the no-threads case we can simply use dummy definitions. */
+typedef int sys_mutex_t;
+typedef int sys_cond_t;
+typedef int sys_thread_t;
+
+#endif /* THREADS_ENABLED */
typedef void *(thread_creation_function) (void *);