OSDN Git Service

* cygtls.cc (_cygtls::init_thread): Set __sdidinit to negative value to
authorcgf <cgf>
Tue, 7 Sep 2004 04:05:13 +0000 (04:05 +0000)
committercgf <cgf>
Tue, 7 Sep 2004 04:05:13 +0000 (04:05 +0000)
indicate that it is "special".
* thread.cc (pthread::exit): If __sdidinit is < 0, it was never really
initialized so reset it to 0 before calling _reclaim_reent.

winsup/cygwin/ChangeLog
winsup/cygwin/cygtls.cc
winsup/cygwin/thread.cc

index 0153cd8..0dbabc8 100644 (file)
@@ -1,3 +1,10 @@
+2004-09-07  Christopher Faylor  <cgf@timesys.com>
+
+       * cygtls.cc (_cygtls::init_thread): Set __sdidinit to negative value to
+       indicate that it is "special".
+       * thread.cc (pthread::exit): If __sdidinit is < 0, it was never really
+       initialized so reset it to 0 before calling _reclaim_reent.
+
 2004-09-05  Christopher Faylor  <cgf@timesys.com>
 
        * include/cygwin/version.h: Bump DLL minor number to 12.
index d2db5eb..a409fda 100644 (file)
@@ -107,7 +107,7 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *))
          local_clib._stdin = _GLOBAL_REENT->_stdin;
          local_clib._stdout = _GLOBAL_REENT->_stdout;
          local_clib._stderr = _GLOBAL_REENT->_stderr;
-         local_clib.__sdidinit = _GLOBAL_REENT->__sdidinit;
+         local_clib.__sdidinit = _GLOBAL_REENT->__sdidinit ? -1 : 0;
          local_clib.__cleanup = _GLOBAL_REENT->__cleanup;
          local_clib.__sglue._niobs = 3;
          local_clib.__sglue._iobs = &_GLOBAL_REENT->__sf[0];
index 7ba7399..b6c2e94 100644 (file)
@@ -355,6 +355,8 @@ pthread::exit (void *value_ptr)
       mutex.unlock ();
     }
 
+  if (_my_tls.local_clib.__sdidinit < 0)
+    _my_tls.local_clib.__sdidinit = 0;
   (_reclaim_reent) (_REENT);