diff options
author | Christopher Faylor <me@cgf.cx> | 2006-03-13 02:57:05 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-03-13 02:57:05 +0300 |
commit | 51f90b2f01642f40b491df371e016b79f02e3f1b (patch) | |
tree | 151d3fb1691443a2fc1d3051a2b66557bd1976f0 /winsup/cygwin/sigproc.cc | |
parent | 0b9632d1fa2c163891dd42e53d773898fa3863af (diff) |
* 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/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 14 |
1 files changed, 8 insertions, 6 deletions
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; } |