* 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.
This commit is contained in:
Christopher Faylor
2006-03-12 23:57:05 +00:00
parent 0b9632d1fa
commit 51f90b2f01
9 changed files with 80 additions and 70 deletions

View File

@@ -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.");