diff options
| author | Tom Tromey | 2012-08-15 13:03:17 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-15 13:03:17 -0600 |
| commit | 14b3dc5e4f2cdefde1ba04ddd3525115e7ca7dce (patch) | |
| tree | af04882e838fea858d9672dac6c19eab374505b9 /src/thread.h | |
| parent | 2d525b793f1b0fd2b6f66881310bec8684bceffe (diff) | |
| download | emacs-14b3dc5e4f2cdefde1ba04ddd3525115e7ca7dce.tar.gz emacs-14b3dc5e4f2cdefde1ba04ddd3525115e7ca7dce.zip | |
This introduces the low-level system threading support. It also adds
the global lock. The low-level support is a bit over-eager, in that
even at the end of the present series, it will not all be used. I
think thiat is ok since I plan to use it all eventually -- in
particular for the emacs lisp mutex implementation.
I've only implemented the pthreads-based version. I think it should
be relatively clear how to port this to other systems, though.
I'd also like to do a "no threads" port that will turn most things
into no-ops, and have thread-creation fail. I was thinking perhaps
I'd make a future (provide 'threads) conditional on threads actually
working.
One other minor enhancement available here is to make it possible to
set the name of the new thread at the OS layer. That way gdb, e.g.,
could display thread names.
Diffstat (limited to 'src/thread.h')
| -rw-r--r-- | src/thread.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread.h b/src/thread.h index 6d61d0e5fcf..020346b9af2 100644 --- a/src/thread.h +++ b/src/thread.h | |||
| @@ -140,6 +140,10 @@ struct thread_state | |||
| 140 | 140 | ||
| 141 | extern struct thread_state *current_thread; | 141 | extern struct thread_state *current_thread; |
| 142 | 142 | ||
| 143 | extern sys_mutex_t global_lock; | ||
| 144 | |||
| 143 | extern void unmark_threads (void); | 145 | extern void unmark_threads (void); |
| 144 | 146 | ||
| 147 | extern void init_threads (void); | ||
| 148 | |||
| 145 | #endif /* THREAD_H */ | 149 | #endif /* THREAD_H */ |