From c9b7c4d019b8ccb9def40fc5f6defa0ec1a00b69 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 18 Sep 2009 12:43:01 +0200 Subject: [PATCH] A new thread maintain the parent's buffer when the thread starts not after it entered in `global_lock'. --- src/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thread.c b/src/thread.c index 4143da714b0..94fb7e42483 100644 --- a/src/thread.c +++ b/src/thread.c @@ -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); -- 2.39.5