aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.c
diff options
context:
space:
mode:
authorTom Tromey2013-07-04 20:00:54 -0600
committerTom Tromey2013-07-04 20:00:54 -0600
commit9db4b98e1356549d999b342bd449f916c27fea8a (patch)
tree6c5aef6e2ba38107fb1981e351b4e202e7ffb925 /src/thread.c
parente7b4d03f5a74b16c924079b75f5b0617c9ee7add (diff)
downloademacs-9db4b98e1356549d999b342bd449f916c27fea8a.tar.gz
emacs-9db4b98e1356549d999b342bd449f916c27fea8a.zip
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
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c5
1 files 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)
337 Lisp_Object cond; 337 Lisp_Object cond;
338 338
339 XSETCONDVAR (cond, cvar); 339 XSETCONDVAR (cond, cvar);
340 current_thread->event_object = cond; 340 self->event_object = cond;
341 saved_count = lisp_mutex_unlock_for_wait (&mutex->mutex); 341 saved_count = lisp_mutex_unlock_for_wait (&mutex->mutex);
342 /* If we were signalled while unlocking, we skip the wait, but we 342 /* If we were signalled while unlocking, we skip the wait, but we
343 still must reacquire our lock. */ 343 still must reacquire our lock. */
@@ -348,7 +348,7 @@ condition_wait_callback (void *arg)
348 self->wait_condvar = NULL; 348 self->wait_condvar = NULL;
349 } 349 }
350 lisp_mutex_lock (&mutex->mutex, saved_count); 350 lisp_mutex_lock (&mutex->mutex, saved_count);
351 current_thread->event_object = Qnil; 351 self->event_object = Qnil;
352 post_acquire_global_lock (self); 352 post_acquire_global_lock (self);
353} 353}
354 354
@@ -614,6 +614,7 @@ static Lisp_Object
614invoke_thread_function (void) 614invoke_thread_function (void)
615{ 615{
616 Lisp_Object iter; 616 Lisp_Object iter;
617 volatile struct thread_state *self = current_thread;
617 618
618 int count = SPECPDL_INDEX (); 619 int count = SPECPDL_INDEX ();
619 620