]> git.eshelyaron.com Git - emacs.git/commitdiff
A new thread maintain the parent's buffer when the thread starts not after it entered...
authorGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 18 Sep 2009 10:43:01 +0000 (12:43 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 18 Sep 2009 10:43:01 +0000 (12:43 +0200)
src/thread.c

index 4143da714b0efaa9ede54cb11f413d0b9bfed185..94fb7e4248313cc8d449bd44dfb1f26a50b450b1 100644 (file)
@@ -182,8 +182,6 @@ run_thread (void *state)
   /* Thread-local assignment.  */
   current_thread = self;
 
-  pthread_mutex_lock (&global_lock);
-
   /* We need special handling to set the initial buffer.  Our parent
      thread is very likely to be using this same buffer so we will
      typically wait for the parent thread to release it first.  */
@@ -192,6 +190,8 @@ run_thread (void *state)
   self->m_current_buffer = 0;
   set_buffer_internal (XBUFFER (buffer));
 
+  pthread_mutex_lock (&global_lock);
+
   /* It might be nice to do something with errors here.  */
   internal_condition_case (invoke_thread_function, Qt, do_nothing);