]> sourceware.org Git - newlib-cygwin.git/commitdiff
* dcrt0.cc (dll_crt0_1): Call newlib __sinit routine to ensure that stdio
authorChristopher Faylor <me@cgf.cx>
Thu, 2 Oct 2003 04:46:59 +0000 (04:46 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 2 Oct 2003 04:46:59 +0000 (04:46 +0000)
buffers are initialized to avoid thread initialization races.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc

index 41c60710a6d76d87ca2e3aa63ad54d002043dec7..59bd2eb935e7dbd6f07f2c1e3cd88463f2f1dead 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-02  Christopher Faylor  <cgf@redhat.com>
+
+       * dcrt0.cc (dll_crt0_1): Call newlib __sinit routine to ensure that
+       stdio buffers are initialized to avoid thread initialization races.
+
 2003-10-01  Christopher Faylor  <cgf@redhat.com>
 
        * path.cc (win32_device_name): Only fill out destination buffer when
index 377d6dd6fb218c3d6029e76cc9c7b39b163d8493..a09b7e81bf27677395650b6371f0629e0a8737f7 100644 (file)
@@ -533,6 +533,8 @@ sigthread::init (const char *s)
   id = GetCurrentThreadId ();
 }
 
+extern "C" void __sinit (_reent *);
+
 /* Take over from libc's crt0.o and start the application. Note the
    various special cases when Cygwin DLL is being runtime loaded (as
    opposed to being link-time loaded by Cygwin apps) from a non
@@ -633,7 +635,10 @@ dll_crt0_1 ()
   /* Initialize pthread mainthread when not forked and it is save to call new,
      otherwise it is reinitalized in fixup_after_fork */
   if (!user_data->forkee)
-    pthread::init_mainthread ();
+    {
+      __sinit (_impure_ptr);
+      pthread::init_mainthread ();
+    }
 
 #ifdef DEBUGGING
   strace.microseconds ();
This page took 0.036874 seconds and 5 git commands to generate.