diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 659e7ae4c..f3382fd88 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-07-21 Corinna Vinschen + + * thread.cc (pthread::init_mainthread): Initialize thread mutex to + type PTHREAD_MUTEX_RECURSIVE, just as for any other thread. + 2014-07-16 Corinna Vinschen * thread.cc (pthread::create): Handle stackaddr as upper bound address. diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index fc70c3752..dc4faac7c 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -358,6 +358,10 @@ pthread::init_mainthread () if (!thread->create_cancel_event ()) api_fatal ("couldn't create cancel event for main thread"); VerifyHandle (thread->win32_obj_id); + /* Make sure the pthread mutex is recursive. See comment in + pthread::precreate (called only for subsequent pthreads) + for a description. */ + thread->mutex.set_type (PTHREAD_MUTEX_RECURSIVE); thread->postcreate (); }