diff options
| author | Tom Tromey | 2013-08-26 08:46:30 -0600 |
|---|---|---|
| committer | Tom Tromey | 2013-08-26 08:46:30 -0600 |
| commit | 2ee7755c8d35aba1d598c9baa910bd5af228f095 (patch) | |
| tree | 0eb4817057fef64fb07767f8b025b4d47fb80cb6 /src/systhread.c | |
| parent | 793ea5055aea85ff9227e1bf0c84ab37edba7201 (diff) | |
| download | emacs-2ee7755c8d35aba1d598c9baa910bd5af228f095.tar.gz emacs-2ee7755c8d35aba1d598c9baa910bd5af228f095.zip | |
implement --enable-threads and a thread-less mode
Diffstat (limited to 'src/systhread.c')
| -rw-r--r-- | src/systhread.c | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/src/systhread.c b/src/systhread.c index ab647528452..8c9ec438d96 100644 --- a/src/systhread.c +++ b/src/systhread.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* System thread definitions | 1 | /* System thread definitions |
| 2 | Copyright (C) 2012 Free Software Foundation, Inc. | 2 | Copyright (C) 2012, 2013 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -20,7 +20,80 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 20 | #include <setjmp.h> | 20 | #include <setjmp.h> |
| 21 | #include "lisp.h" | 21 | #include "lisp.h" |
| 22 | 22 | ||
| 23 | #ifdef HAVE_PTHREAD | 23 | #ifndef THREADS_ENABLED |
| 24 | |||
| 25 | void | ||
| 26 | sys_mutex_init (sys_mutex_t *m) | ||
| 27 | { | ||
| 28 | *m = 0; | ||
| 29 | } | ||
| 30 | |||
| 31 | void | ||
| 32 | sys_mutex_lock (sys_mutex_t *m) | ||
| 33 | { | ||
| 34 | } | ||
| 35 | |||
| 36 | void | ||
| 37 | sys_mutex_unlock (sys_mutex_t *m) | ||
| 38 | { | ||
| 39 | } | ||
| 40 | |||
| 41 | void | ||
| 42 | sys_mutex_destroy (sys_mutex_t *m) | ||
| 43 | { | ||
| 44 | } | ||
| 45 | |||
| 46 | void | ||
| 47 | sys_cond_init (sys_cond_t *c) | ||
| 48 | { | ||
| 49 | *c = 0; | ||
| 50 | } | ||
| 51 | |||
| 52 | void | ||
| 53 | sys_cond_wait (sys_cond_t *c, sys_mutex_t *m) | ||
| 54 | { | ||
| 55 | } | ||
| 56 | |||
| 57 | void | ||
| 58 | sys_cond_signal (sys_cond_t *c) | ||
| 59 | { | ||
| 60 | } | ||
| 61 | |||
| 62 | void | ||
| 63 | sys_cond_broadcast (sys_cond_t *c) | ||
| 64 | { | ||
| 65 | } | ||
| 66 | |||
| 67 | void | ||
| 68 | sys_cond_destroy (sys_cond_t *c) | ||
| 69 | { | ||
| 70 | } | ||
| 71 | |||
| 72 | sys_thread_t | ||
| 73 | sys_thread_self (void) | ||
| 74 | { | ||
| 75 | return 0; | ||
| 76 | } | ||
| 77 | |||
| 78 | int | ||
| 79 | sys_thread_equal (sys_thread_t x, sys_thread_t y) | ||
| 80 | { | ||
| 81 | return x == y; | ||
| 82 | } | ||
| 83 | |||
| 84 | int | ||
| 85 | sys_thread_create (sys_thread_t *t, const char *name, | ||
| 86 | thread_creation_function *func, void *datum) | ||
| 87 | { | ||
| 88 | return 0; | ||
| 89 | } | ||
| 90 | |||
| 91 | void | ||
| 92 | sys_thread_yield (void) | ||
| 93 | { | ||
| 94 | } | ||
| 95 | |||
| 96 | #elif defined (HAVE_PTHREAD) | ||
| 24 | 97 | ||
| 25 | #include <sched.h> | 98 | #include <sched.h> |
| 26 | 99 | ||