summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivano@gnu.org>2011-02-17 12:29:17 +0100
committerGiuseppe Scrivano <gscrivano@gnu.org>2011-02-17 12:29:17 +0100
commit38dba5e8d27b7504ac29b7d1f92b3478995204f1 (patch)
tree7ee67d85ee40d7438813aed619923532815dd22c
parentf17afbf5c25bd0901eb5d9800a07b9e8b7981293 (diff)
downloademacs-other-branches/old-concurrency.tar.gz
make the minibuffer mutex recursive.other-branches/old-concurrency
-rw-r--r--src/thread.c6
-rw-r--r--src/thread.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/thread.c b/src/thread.c
index 151bb0ea6be..0be143cfcbb 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -356,7 +356,7 @@ DEFUN ("make-mutex", Fmake_mutex, Smake_mutex, 0, 1, 0,
struct Lisp_Mutex *mutex = allocate_mutex ();
mutex->owner = 0;
mutex->rec_counter = 0;
- mutex->recursive = ! NILP (recursive);
+ mutex->recursive = recursive;
XSETMUTEX (ret, mutex);
return ret;
}
@@ -370,7 +370,7 @@ DEFUN ("mutex-lock", Fmutex_lock, Smutex_lock, 1, 1, 0,
while (1)
{
if (mutex->owner == 0
- || (mutex->recursive && mutex->owner == pthread_self ()))
+ || (!NILP (mutex->recursive) && mutex->owner == pthread_self ()))
{
mutex->owner = pthread_self ();
mutex->rec_counter++;
@@ -462,7 +462,7 @@ init_threads_once (void)
primary_thread.func = Qnil;
primary_thread.initial_specpdl = Qnil;
XSETPVECTYPE (&primary_thread, PVEC_THREAD);
- minibuffer_mutex = Fmake_mutex (Qnil);
+ minibuffer_mutex = Fmake_mutex (Qt);
}
void
diff --git a/src/thread.h b/src/thread.h
index 8fb0cb8bc20..573d1ecd1da 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -7,7 +7,7 @@ struct Lisp_Mutex
struct Lisp_Vector *v_next;
/* Is the mutex recursive? */
- int recursive;
+ Lisp_Object recursive;
/* Thread that owns the mutex. */
pthread_t owner;