* sigproc.cc (no_signals_available): Finally remove this macro entirely.

(exit_thread): Ensure process lock is released on error exit.
(sig_send): Simplify "its_me" test.  Remove no_signals_available tests.
This commit is contained in:
Christopher Faylor 2013-01-16 23:04:28 +00:00
parent f432e328af
commit 211dd84b83
2 changed files with 10 additions and 14 deletions

View File

@ -1,3 +1,10 @@
2013-01-16 Christopher Faylor <me.cygwin2013@cgf.cx>
* sigproc.cc (no_signals_available): Finally remove this macro
entirely.
(exit_thread): Ensure process lock is released on error exit.
(sig_send): Simplify "its_me" test. Remove no_signals_available tests.
2013-01-16 Christopher Faylor <me.cygwin2013@cgf.cx>
* pthread.cc (pthread_exit): Add kludge to accommodate noreturn attribute.

View File

@ -31,8 +31,6 @@ details. */
#define WSSC 60000 // Wait for signal completion
#define WPSP 40000 // Wait for proc_subproc mutex
#define no_signals_available() ((myself->exitcode & EXITCODE_SET) || (&_my_tls == _sig_tls))
/*
* Global variables
*/
@ -489,6 +487,7 @@ exit_thread (DWORD res)
#ifdef DEBUGGING
system_printf ("couldn't duplicate the current thread, %E");
#endif
for_now.release ();
ExitThread (res);
}
ProtectHandle1 (h, exit_thread);
@ -543,7 +542,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
pack.wakeup = NULL;
bool wait_for_completion;
if (!(its_me = (!have_execed && (p == NULL || p == myself || p == myself_nowait))))
if (!(its_me = p == NULL || p == myself || p == myself_nowait))
{
/* It is possible that the process is not yet ready to receive messages
* or that it has exited. Detect this.
@ -558,11 +557,6 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
}
else
{
if (no_signals_available ())
{
set_errno (EAGAIN);
goto out; // Either exiting or not yet initializing
}
wait_for_completion = p != myself_nowait;
p = myself;
}
@ -688,9 +682,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
}
else
{
if (no_signals_available ())
sigproc_printf ("I'm going away now");
else if (!p->exec_sendsig)
if (!p->exec_sendsig)
system_printf ("error sending signal %d to pid %d, pipe handle %p, %E",
si.si_signo, p->pid, sendsig);
}
@ -728,9 +720,6 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
rc = 0; // Successful exit
else
{
if (!no_signals_available ())
system_printf ("wait for sig_complete event failed, signal %d, rc %d, %E",
si.si_signo, rc);
set_errno (ENOSYS);
rc = -1;
}