diff options
author | Christopher Faylor <me@cgf.cx> | 2011-11-26 02:35:49 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-11-26 02:35:49 +0000 |
commit | 1d04c4c6c36f307f79a5617bc62e1a766ce01355 (patch) | |
tree | ed3dfe5a96d9fe9353e5eb1927df7aa8f3a20a1e /winsup/cygwin/exceptions.cc | |
parent | 505bce274fe261526833f77f7bf24b33542da151 (diff) | |
download | cygnal-1d04c4c6c36f307f79a5617bc62e1a766ce01355.tar.gz cygnal-1d04c4c6c36f307f79a5617bc62e1a766ce01355.tar.bz2 cygnal-1d04c4c6c36f307f79a5617bc62e1a766ce01355.zip |
* exceptions.cc (sigpacket::process): Move signal_exit processing into...
(_cygtls::signal_exit): ...here. Close my_readsig and comment on why.
* pinfo.cc (pinfo::exit): Move sigproc_terminate earlier. Set exiting flag in
lock_process.
* sigproc.cc (my_readsig): Make global.
* sync.cc (muto::exiting_thread): Delete.
(muto::acquire): Delete #if 0'ed code.
* sync.h (muto::exiting_thread): Delete.
(set_exiting_thread): Ditto.
(lock_process::lock_process): Don't worry about setting the exiting thread
since it had no meaning.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 98707e22a..b84a9fb35 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1307,17 +1307,6 @@ thread_specific: goto done; exit_sig: - if (si.si_signo == SIGQUIT || si.si_signo == SIGABRT) - { - CONTEXT c; - c.ContextFlags = CONTEXT_FULL; - GetThreadContext (hMainThread, &c); - use_tls->copy_context (&c); - if (cygheap->rlim_core > 0UL) - si.si_signo |= 0x80; - } - SetEvent (signal_arrived); // To avoid a potential deadlock with proc_lock - sigproc_printf ("signal %d, about to call do_exit", si.si_signo); use_tls->signal_exit (si.si_signo); /* never returns */ } @@ -1327,6 +1316,20 @@ exit_sig: void _cygtls::signal_exit (int rc) { + extern HANDLE my_readsig; + ForceCloseHandle (my_readsig); /* Disallow further signal sends */ + SetEvent (signal_arrived); /* Avoid potential deadlock with proc_lock */ + + if (rc == SIGQUIT || rc == SIGABRT) + { + CONTEXT c; + c.ContextFlags = CONTEXT_FULL; + GetThreadContext (hMainThread, &c); + copy_context (&c); + if (cygheap->rlim_core > 0UL) + rc |= 0x80; + } + if (have_execed) { sigproc_printf ("terminating captive process"); |