aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
356 struct Lisp_Mutex *mutex = allocate_mutex (); 356 struct Lisp_Mutex *mutex = allocate_mutex ();
357 mutex->owner = 0; 357 mutex->owner = 0;
358 mutex->rec_counter = 0; 358 mutex->rec_counter = 0;
359 mutex->recursive = ! NILP (recursive); 359 mutex->recursive = recursive;
360 XSETMUTEX (ret, mutex); 360 XSETMUTEX (ret, mutex);
361 return ret; 361 return ret;
362} 362}
@@ -370,7 +370,7 @@ DEFUN ("mutex-lock", Fmutex_lock, Smutex_lock, 1, 1, 0,
370 while (1) 370 while (1)
371 { 371 {
372 if (mutex->owner == 0 372 if (mutex->owner == 0
373 || (mutex->recursive && mutex->owner == pthread_self ())) 373 || (!NILP (mutex->recursive) && mutex->owner == pthread_self ()))
374 { 374 {
375 mutex->owner = pthread_self (); 375 mutex->owner = pthread_self ();
376 mutex->rec_counter++; 376 mutex->rec_counter++;
@@ -462,7 +462,7 @@ init_threads_once (void)
462 primary_thread.func = Qnil; 462 primary_thread.func = Qnil;
463 primary_thread.initial_specpdl = Qnil; 463 primary_thread.initial_specpdl = Qnil;
464 XSETPVECTYPE (&primary_thread, PVEC_THREAD); 464 XSETPVECTYPE (&primary_thread, PVEC_THREAD);
465 minibuffer_mutex = Fmake_mutex (Qnil); 465 minibuffer_mutex = Fmake_mutex (Qt);
466} 466}
467 467
468void 468void
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
7 struct Lisp_Vector *v_next; 7 struct Lisp_Vector *v_next;
8 8
9 /* Is the mutex recursive? */ 9 /* Is the mutex recursive? */
10 int recursive; 10 Lisp_Object recursive;
11 11
12 /* Thread that owns the mutex. */ 12 /* Thread that owns the mutex. */
13 pthread_t owner; 13 pthread_t owner;