summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-03-12 23:57:05 +0000
committerChristopher Faylor <me@cgf.cx>2006-03-12 23:57:05 +0000
commit51f90b2f01642f40b491df371e016b79f02e3f1b (patch)
tree151d3fb1691443a2fc1d3051a2b66557bd1976f0 /winsup/cygwin/dcrt0.cc
parent0b9632d1fa2c163891dd42e53d773898fa3863af (diff)
downloadcygnal-51f90b2f01642f40b491df371e016b79f02e3f1b.tar.gz
cygnal-51f90b2f01642f40b491df371e016b79f02e3f1b.tar.bz2
cygnal-51f90b2f01642f40b491df371e016b79f02e3f1b.zip
* cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value.
(CYGTLSMAGIC): Delete. * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup. (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here. * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr if we have a valid tls. * fork.cc (frok::child): Remove sigproc_init initialization since it happens much earlier now. * gendef: Recognize SIGFE_MAYBE. (fefunc): Generate calls to _sigfe_maybe, if appropriate. (_sigfe_maybe): New function. * init.cc (search_for): Always initialize search_for, even on fork. (calibration_thread): Delete. (calibration_id): Delete. (prime_threads): Delete. (munge_threadfunc): Remove calibration_thread special case. Avoid calling thread function if we haven't yet hit the "search_for" thread. (dll_entry): Remove prime_threads call. Only call munge_threadfunc when hwait_sig is active. Ditto. for _my_tls.remove (); * sigproc.cc (hwait_sig): Make global. (sigproc_init): Don't bother with sync_startup. (sig_send): Treat flush as a no-op when signals are held. (wait_sig): Cause signals to be held after fork.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 8122939b6..9da090f30 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -750,6 +750,8 @@ dll_crt0_0 ()
DuplicateTokenEx (hProcToken, MAXIMUM_ALLOWED, NULL,
SecurityImpersonation, TokenImpersonation,
&hProcImpToken);
+ /* Initialize signal/subprocess handling. */
+ sigproc_init ();
debug_printf ("finished dll_crt0_0 initialization");
}
@@ -835,9 +837,6 @@ dll_crt0_1 (char *)
/* Initialize user info. */
uinfo_init ();
- /* Initialize signal/subprocess handling. */
- sigproc_init ();
-
/* Connect to tty. */
tty_init ();
@@ -924,7 +923,6 @@ dll_crt0_1 (char *)
/* Flush signals and ensure that signal thread is up and running. Can't
do this for noncygwin case since the signal thread is blocked due to
LoadLibrary serialization. */
- wait_for_sigthread ();
ld_preload ();
if (user_data->main)
cygwin_exit (user_data->main (__argc, __argv, *user_data->envptr));
@@ -950,14 +948,8 @@ initialize_main_tls (char *padding)
extern "C" void __stdcall
_dll_crt0 ()
{
- extern HANDLE sync_startup;
extern DWORD threadfunc_ix;
- if (sync_startup != INVALID_HANDLE_VALUE)
- {
- WaitForSingleObject (sync_startup, INFINITE);
- CloseHandle (sync_startup);
- }
-
+ wait_for_sigthread ();
if (!threadfunc_ix)
system_printf ("internal error: couldn't determine location of thread function on stack. Expect signal problems.");