diff options
| author | Tom Tromey | 2012-08-18 19:59:47 -0600 |
|---|---|---|
| committer | Tom Tromey | 2012-08-18 19:59:47 -0600 |
| commit | b3c78ffa31af4fb96cc18da887e2f2a1e68f5e09 (patch) | |
| tree | 18d4319fc883400ed308786357d5628e9e67d384 /src/thread.h | |
| parent | f52cfea0dcea4ae9599d4a775901ca06a0517f56 (diff) | |
| download | emacs-b3c78ffa31af4fb96cc18da887e2f2a1e68f5e09.tar.gz emacs-b3c78ffa31af4fb96cc18da887e2f2a1e68f5e09.zip | |
refactor systhread.h
This refactors systhread.h to move the notion of a "lisp mutex"
into thread.c. This lets us make make the global lock and
post_acquire_global_lock static.
Diffstat (limited to 'src/thread.h')
| -rw-r--r-- | src/thread.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/thread.h b/src/thread.h index 9db3c795653..32ef48f63ff 100644 --- a/src/thread.h +++ b/src/thread.h | |||
| @@ -187,6 +187,19 @@ struct thread_state | |||
| 187 | struct thread_state *next_thread; | 187 | struct thread_state *next_thread; |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | /* A mutex in lisp is represented by a pthread condition variable. | ||
| 191 | The system mutex associated with this condition variable is the | ||
| 192 | global lock. | ||
| 193 | |||
| 194 | Using a condition variable lets us implement interruptibility for | ||
| 195 | lisp mutexes. */ | ||
| 196 | typedef struct | ||
| 197 | { | ||
| 198 | struct thread_state *owner; | ||
| 199 | unsigned int count; | ||
| 200 | sys_cond_t condition; | ||
| 201 | } lisp_mutex_t; | ||
| 202 | |||
| 190 | struct Lisp_Mutex | 203 | struct Lisp_Mutex |
| 191 | { | 204 | { |
| 192 | struct vectorlike_header header; | 205 | struct vectorlike_header header; |
| @@ -198,9 +211,6 @@ struct Lisp_Mutex | |||
| 198 | 211 | ||
| 199 | extern struct thread_state *current_thread; | 212 | extern struct thread_state *current_thread; |
| 200 | 213 | ||
| 201 | extern sys_mutex_t global_lock; | ||
| 202 | extern void post_acquire_global_lock (struct thread_state *); | ||
| 203 | |||
| 204 | extern void unmark_threads (void); | 214 | extern void unmark_threads (void); |
| 205 | extern void finalize_one_thread (struct thread_state *state); | 215 | extern void finalize_one_thread (struct thread_state *state); |
| 206 | extern void finalize_one_mutex (struct Lisp_Mutex *); | 216 | extern void finalize_one_mutex (struct Lisp_Mutex *); |