aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.h
diff options
context:
space:
mode:
authorTom Tromey2012-08-18 19:59:47 -0600
committerTom Tromey2012-08-18 19:59:47 -0600
commitb3c78ffa31af4fb96cc18da887e2f2a1e68f5e09 (patch)
tree18d4319fc883400ed308786357d5628e9e67d384 /src/thread.h
parentf52cfea0dcea4ae9599d4a775901ca06a0517f56 (diff)
downloademacs-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.h16
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. */
196typedef struct
197{
198 struct thread_state *owner;
199 unsigned int count;
200 sys_cond_t condition;
201} lisp_mutex_t;
202
190struct Lisp_Mutex 203struct Lisp_Mutex
191{ 204{
192 struct vectorlike_header header; 205 struct vectorlike_header header;
@@ -198,9 +211,6 @@ struct Lisp_Mutex
198 211
199extern struct thread_state *current_thread; 212extern struct thread_state *current_thread;
200 213
201extern sys_mutex_t global_lock;
202extern void post_acquire_global_lock (struct thread_state *);
203
204extern void unmark_threads (void); 214extern void unmark_threads (void);
205extern void finalize_one_thread (struct thread_state *state); 215extern void finalize_one_thread (struct thread_state *state);
206extern void finalize_one_mutex (struct Lisp_Mutex *); 216extern void finalize_one_mutex (struct Lisp_Mutex *);