* 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

@ -61,10 +61,10 @@ HANDLE NO_COPY signal_arrived; // Event signaled when a signal has
HANDLE NO_COPY sigCONT; // Used to "STOP" a process
Static cygthread *hwait_sig;
cygthread *hwait_sig;
Static HANDLE wait_sig_inited; // Control synchronization of
// message queue startup
Static bool sigheld; // True if holding signals
static bool sigheld; // True if holding signals
Static int nprocs; // Number of deceased children
Static char cprocs[(NPROCS + 1) * sizeof (pinfo)];// All my children info
@ -475,7 +475,6 @@ create_signal_arrived ()
void __stdcall
sigproc_init ()
{
extern HANDLE sync_startup;
wait_sig_inited = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
ProtectHandle (wait_sig_inited);
@ -484,7 +483,6 @@ sigproc_init ()
*/
sync_proc_subproc.init ("sync_proc_subproc");
sync_startup = NULL;
hwait_sig = new cygthread (wait_sig, 0, cygself, "sig");
hwait_sig->zap_h ();
@ -523,6 +521,8 @@ sig_send (_pinfo *p, int sig)
#endif
return -1;
}
else if (sig == __SIGFLUSH || sig == __SIGFLUSHFAST)
return 0;
else
{
SetEvent (sigCONT);
@ -1091,8 +1091,12 @@ wait_sig (VOID *)
readsig, myself->sendsig);
sigpacket pack;
if (in_forkee)
pack.si.si_signo = __SIGHOLD;
for (;;)
{
if (pack.si.si_signo == __SIGHOLD)
WaitForSingleObject (sigCONT, INFINITE);
DWORD nb;
pack.tls = NULL;
if (!ReadFile (readsig, &pack, sizeof (pack), &nb, NULL))
@ -1194,8 +1198,6 @@ wait_sig (VOID *)
sigproc_printf ("signalling pack.wakeup %p", pack.wakeup);
SetEvent (pack.wakeup);
}
if (pack.si.si_signo == __SIGHOLD)
WaitForSingleObject (sigCONT, INFINITE);
if (pack.si.si_signo == __SIGEXIT)
break;
}