summaryrefslogtreecommitdiff
path: root/src/thread.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-08-18 19:59:47 -0600
committerTom Tromey <tromey@redhat.com>2012-08-18 19:59:47 -0600
commitb3c78ffa31af4fb96cc18da887e2f2a1e68f5e09 (patch)
tree18d4319fc883400ed308786357d5628e9e67d384 /src/thread.h
parentf52cfea0dcea4ae9599d4a775901ca06a0517f56 (diff)
downloademacs-b3c78ffa31af4fb96cc18da887e2f2a1e68f5e09.tar.gz
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
struct thread_state *next_thread;
};
+/* A mutex in lisp is represented by a pthread condition variable.
+ The system mutex associated with this condition variable is the
+ global lock.
+
+ Using a condition variable lets us implement interruptibility for
+ lisp mutexes. */
+typedef struct
+{
+ struct thread_state *owner;
+ unsigned int count;
+ sys_cond_t condition;
+} lisp_mutex_t;
+
struct Lisp_Mutex
{
struct vectorlike_header header;
@@ -198,9 +211,6 @@ struct Lisp_Mutex
extern struct thread_state *current_thread;
-extern sys_mutex_t global_lock;
-extern void post_acquire_global_lock (struct thread_state *);
-
extern void unmark_threads (void);
extern void finalize_one_thread (struct thread_state *state);
extern void finalize_one_mutex (struct Lisp_Mutex *);