From 51f90b2f01642f40b491df371e016b79f02e3f1b Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 12 Mar 2006 23:57:05 +0000 Subject: * 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. --- winsup/cygwin/sigproc.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/sigproc.cc') diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 5e9ad1915..845f7cd80 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -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; } -- cgit v1.2.3