diff options
author | Christopher Faylor <me@cgf.cx> | 2010-09-01 18:24:11 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-09-01 18:24:11 +0000 |
commit | b9874a0c1409a238de44a2413b8a82875fd68084 (patch) | |
tree | ed19075870bced5696f7d7ed1456a784d1ba6a3b /winsup/cygwin/init.cc | |
parent | 20973ec94886bf3b465f94430ea3d45eaaaf43a3 (diff) | |
download | cygnal-b9874a0c1409a238de44a2413b8a82875fd68084.tar.gz cygnal-b9874a0c1409a238de44a2413b8a82875fd68084.tar.bz2 cygnal-b9874a0c1409a238de44a2413b8a82875fd68084.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r-- | winsup/cygwin/init.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index 9bf49f2a3..0f6b67e88 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -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; |