From 9db4b98e1356549d999b342bd449f916c27fea8a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 4 Jul 2013 20:00:54 -0600 Subject: [PATCH] avoid current_thread sometimes this tweaks thread.c to use 'self' instead of current_thread in a couple spots. this is clearer and more robust --- src/thread.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/thread.c b/src/thread.c index 8a81a1021a6..99ca21bdc84 100644 --- a/src/thread.c +++ b/src/thread.c @@ -337,7 +337,7 @@ condition_wait_callback (void *arg) Lisp_Object cond; XSETCONDVAR (cond, cvar); - current_thread->event_object = cond; + self->event_object = cond; saved_count = lisp_mutex_unlock_for_wait (&mutex->mutex); /* If we were signalled while unlocking, we skip the wait, but we still must reacquire our lock. */ @@ -348,7 +348,7 @@ condition_wait_callback (void *arg) self->wait_condvar = NULL; } lisp_mutex_lock (&mutex->mutex, saved_count); - current_thread->event_object = Qnil; + self->event_object = Qnil; post_acquire_global_lock (self); } @@ -614,6 +614,7 @@ static Lisp_Object invoke_thread_function (void) { Lisp_Object iter; + volatile struct thread_state *self = current_thread; int count = SPECPDL_INDEX (); -- 2.39.5