]> git.eshelyaron.com Git - emacs.git/commitdiff
make the minibuffer mutex recursive. other-branches/old-concurrency
authorGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 17 Feb 2011 11:29:17 +0000 (12:29 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 17 Feb 2011 11:29:17 +0000 (12:29 +0100)
src/thread.c
src/thread.h

index 151bb0ea6be6a1cd06e1ac7d9d04e59546612440..0be143cfcbbea261fa8ce57b7c694b0498e0d55c 100644 (file)
@@ -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
index 8fb0cb8bc20c867b744fe8c9606c331bbb160d9a..573d1ecd1da1fa9e5918be4fcd9133afe58fdb50 100644 (file)
@@ -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;