From 38dba5e8d27b7504ac29b7d1f92b3478995204f1 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 17 Feb 2011 12:29:17 +0100 Subject: [PATCH] make the minibuffer mutex recursive. --- src/thread.c | 6 +++--- src/thread.h | 2 +- 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; -- 2.11.4.GIT