* DevNotes: Add entry cgf-000018.

* init.cc (dll_entry): Grab process lock before exiting to ensure that thread
doesn't exit before parent if parent is exiting.
* _cygtls.cc (_cygtls::call2): Revert previous 2012-12-21 change.
* miscfuncs.cc (thread_wrapper): Ditto.
* thread.cc (pthread::exit): Ditto.
* sigproc.cc (exit_thread): Ditto.
(wait_sig): Ditto.
* sync.cc (muto::release): Ditto.
* sync.h (muto::release): Ditto.
* sigproc.h (__SIGTHREADEXIT): Delete enum.
(exit_thread): Delete declaration.
This commit is contained in:
Christopher Faylor
2012-12-21 19:32:43 +00:00
parent 614aff88a0
commit 65068ebd7f
10 changed files with 45 additions and 61 deletions

View File

@ -13,6 +13,7 @@ details. */
#include "cygtls.h"
#include "ntdll.h"
#include "shared_info.h"
#include "sync.h"
static DWORD _my_oldfunc;
@ -95,7 +96,14 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
if (dll_finished_loading
&& (PVOID) &_my_tls > (PVOID) &test_stack_marker
&& _my_tls.isinitialized ())
_my_tls.remove (0);
{
_my_tls.remove (0);
/* Make sure that we don't exit until the process has exited.
Otherwise there is a potential race where the thread exit
code could be considered to be the process exit code.
See cgf-000017 and cgf-000018 in DevNotes. */
lock_process here;
}
/* Windows 2000 has a bug in NtTerminateThread. Instead of releasing
the stack at teb->DeallocationStack it uses the value of
teb->Tib.StackLimit to evaluate the stack address. So we just claim