Required for the rwlock patch.

2003-02-27  Thomas Pfaff  <[EMAIL PROTECTED]>

        * thread.cc (MTinterface::fixup_after_fork): Initialize mainthread
        prior to pthread objects.

diff -urp src.old/winsup/cygwin/thread.cc src/winsup/cygwin/thread.cc
--- src.old/winsup/cygwin/thread.cc     2003-01-14 21:32:26.000000000 +0100
+++ src/winsup/cygwin/thread.cc 2003-02-26 16:59:41.000000000 +0100
@@ -213,6 +213,10 @@ void
 MTinterface::fixup_after_fork (void)
 {
   pthread_key::fixup_after_fork ();
+
+  threadcount = 1;
+  pthread::initMainThread (true);
+
   pthread_mutex *mutex = mutexs;
   debug_printf ("mutexs is %x",mutexs);
   while (mutex)
@@ -234,10 +238,6 @@ MTinterface::fixup_after_fork (void)
       sem->fixup_after_fork ();
       sem = sem->next;
     }
-
-  pthread::initMainThread (true);
-
-  threadcount = 1;
 }
 
 /* pthread calls */

Reply via email to