From: Giuseppe Scrivano Date: Wed, 16 Sep 2009 12:52:07 +0000 (+0200) Subject: Revert to the previous code. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=66e853b7f851fc5ace6888ae04cd14971bd8de06;p=emacs.git Revert to the previous code. --- diff --git a/src/thread.c b/src/thread.c index b5c1aaca1a4..9a19e0632c3 100644 --- a/src/thread.c +++ b/src/thread.c @@ -151,6 +151,7 @@ static void * run_thread (void *state) { struct thread_state *self = state; + struct thread_state **iter; struct gcpro gcpro1; Lisp_Object buffer; char stack_pos; @@ -179,16 +180,9 @@ run_thread (void *state) internal_condition_case (invoke_thread_function, Qt, do_nothing); /* Unlink this thread from the list of all threads. */ - if (all_threads == self) - all_threads = all_threads->next_thread; - else - { - struct thread_state *prev; - for (prev = all_threads; prev->next_thread != self; - prev = prev->next_thread) - ; - prev->next_thread = self->next_thread; - } + for (iter = &all_threads; *iter != self; iter = &(*iter)->next_thread) + ; + *iter = (*iter)->next_thread; release_buffer (self);