* cygthread.cc (cygthread::create): Fix incorrect use of name rather than

__name.
* cygthread.h (cygthread::cygthread): Create versions which eliminate 'n'
parameter.
* dcrt0.cc (dll_crt0_1): Remove check for threadfunc_ix.  Remove obsolete
comments.  Set process_state to active here.
* fhandler_netdrive.cc (create_thread_and_wait): Use shortened cygthread
constructor.
* timer.cc (timer_tracker::settime): Ditto.
* window.cc (HWND): Ditto.
* fhandler_tty.cc: Use shortened cygthread constructor, where appropriate,
throughout.
* select.cc: Ditto.
* fork.cc (frok::child): Remove wait_for_sigthread.
(fork): Reformat if for slightly better clarity.
* init.cc (dll_finished_loading): New variable.
(dll_entry): Use dll_finished_loading to determine when we should call
merge_threadfunc.
* sigproc.cc (no_signals_available): Simplify by using my_readsig.
(wait_sig_inited): Delete.
(wait_sig): Define as void function.
(pending_signals): Accommodate change to wait_sig definition.
(wait_for_sigthread): Delete definition.
(sigproc_init): Initialize signal pipe here, before wait_sig thread is created.
Use void form of cygthread creation.
(init_sig_pipe): Delete.
(wait_sig): Return void rather than DWORD.  Assume previous initialization of
signal pipe.  Set my_sendsig to NULL when exiting.
* sigproc.h (wait_for_sigthread): Delete declaration.
This commit is contained in:
Christopher Faylor
2010-09-01 18:24:11 +00:00
parent 20973ec948
commit b9874a0c14
14 changed files with 91 additions and 98 deletions

View File

@ -18,8 +18,8 @@ static DWORD _my_oldfunc;
static char NO_COPY *search_for = (char *) cygthread::stub;
unsigned threadfunc_ix[8] __attribute__((section (".cygwin_dll_common"), shared));
extern cygthread *hwait_sig;
static bool dll_finished_loading;
#define OLDFUNC_OFFSET -1
static void WINAPI
@ -138,17 +138,18 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
dll_crt0_0 ();
_my_oldfunc = TlsAlloc ();
dll_finished_loading = true;
break;
case DLL_PROCESS_DETACH:
if (dynamically_loaded)
shared_destroy ();
break;
case DLL_THREAD_ATTACH:
if (hwait_sig)
if (dll_finished_loading)
munge_threadfunc ();
break;
case DLL_THREAD_DETACH:
if (hwait_sig && (void *) &_my_tls > (void *) &wow64_test_stack_marker
if (dll_finished_loading && (void *) &_my_tls > (void *) &wow64_test_stack_marker
&& _my_tls.isinitialized ())
_my_tls.remove (0);
break;