Commit 38dba5e8 authored by Giuseppe Scrivano's avatar Giuseppe Scrivano

make the minibuffer mutex recursive.

parent f17afbf5
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment