diff options
author | Thomas Pfaff <tpfaff@gmx.net> | 2003-11-11 19:10:47 +0000 |
---|---|---|
committer | Thomas Pfaff <tpfaff@gmx.net> | 2003-11-11 19:10:47 +0000 |
commit | 068834a10fd795d3a4e113341d6c1cc8eb0e2fe7 (patch) | |
tree | eb8529fb2a2e9982f098ca802978055f7e75f7f7 | |
parent | 030441fc690a0a03107c00fe619b0429fbc6196d (diff) | |
download | cygnal-068834a10fd795d3a4e113341d6c1cc8eb0e2fe7.tar.gz cygnal-068834a10fd795d3a4e113341d6c1cc8eb0e2fe7.tar.bz2 cygnal-068834a10fd795d3a4e113341d6c1cc8eb0e2fe7.zip |
* thread.cc (pthread::exit): Cleanup on thread exit.
(__reent_t::init_clib): Set thread local clib __cleanup var
appropriately.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7a9587714..4736150e1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2003-11-11 Christopher Faylor <cgf@redhat.com> + Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::exit): Cleanup on thread exit. + (__reent_t::init_clib): Set thread local clib __cleanup var + appropriately. + 2003-11-10 Christopher Faylor <cgf@redhat.com> * miscfuncs.cc (low_priority_sleep): Make a "C" function. diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 93aeb97db..d5a393691 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -377,6 +377,8 @@ pthread::exit (void *value_ptr) mutex.unlock (); } + (_reclaim_reent) (_REENT); + if (InterlockedDecrement (&MT_INTERFACE->threadcount) == 0) ::exit (0); else @@ -1879,6 +1881,7 @@ __reent_t::init_clib (struct _reent& var) var._stdout = _GLOBAL_REENT->_stdout; var._stderr = _GLOBAL_REENT->_stderr; var.__sdidinit = _GLOBAL_REENT->__sdidinit; + var.__cleanup = _GLOBAL_REENT->__cleanup; _clib = &var; }; |