* pinfo.h (EXITCODE_SET): Move out of range of Windows error.
(EXITCODE_NOSET): Ditto. * sigproc.cc (no_signals_available): Remove check for hwait_sig. Just rely on my_sendsig. Pass in an argument controlling when it is appropriate to test EXITCODE_SET. (proc_can_be_signalled): Remove checks for myself since this function is never called in that context. (sigproc_init): Pre-initialize my_sendsig to non-zero so that proc_can_be_signalled will know that we expect to be signalable soon. (sig_send): Change debugging output.
This commit is contained in:
parent
150f3bd168
commit
882dfbf776
@ -1,3 +1,16 @@
|
||||
2005-09-15 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* pinfo.h (EXITCODE_SET): Move out of range of Windows error.
|
||||
(EXITCODE_NOSET): Ditto.
|
||||
* sigproc.cc (no_signals_available): Remove check for hwait_sig. Just
|
||||
rely on my_sendsig. Pass in an argument controlling when it is
|
||||
appropriate to test EXITCODE_SET.
|
||||
(proc_can_be_signalled): Remove checks for myself since this function
|
||||
is never called in that context.
|
||||
(sigproc_init): Pre-initialize my_sendsig to non-zero so that
|
||||
proc_can_be_signalled will know that we expect to be signalable soon.
|
||||
(sig_send): Change debugging output.
|
||||
|
||||
2005-09-15 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* sigproc.cc (no_signals_available): Return true if sending to self
|
||||
|
@ -31,8 +31,8 @@ enum picom
|
||||
PICOM_PIPE_FHANDLER = 7
|
||||
};
|
||||
|
||||
#define EXITCODE_SET 0x80000000
|
||||
#define EXITCODE_NOSET 0x40000000
|
||||
#define EXITCODE_SET 0x8000000
|
||||
#define EXITCODE_NOSET 0x4000000
|
||||
|
||||
class fhandler_pipe;
|
||||
|
||||
|
@ -38,7 +38,7 @@ details. */
|
||||
#define WSSC 60000 // Wait for signal completion
|
||||
#define WPSP 40000 // Wait for proc_subproc mutex
|
||||
|
||||
#define no_signals_available() (!hwait_sig || (myself->exitcode & EXITCODE_SET) || !my_sendsig || &_my_tls == _sig_tls)
|
||||
#define no_signals_available(x) (!my_sendsig || ((x) && myself->exitcode & EXITCODE_SET) || &_my_tls == _sig_tls)
|
||||
|
||||
#define NPROCS 256
|
||||
|
||||
@ -59,7 +59,6 @@ HANDLE NO_COPY signal_arrived; // Event signaled when a signal has
|
||||
#define Static static NO_COPY
|
||||
|
||||
HANDLE NO_COPY sigCONT; // Used to "STOP" a process
|
||||
Static cygthread *hwait_sig; // Handle of wait_sig thread
|
||||
|
||||
Static HANDLE wait_sig_inited; // Control synchronization of
|
||||
// message queue startup
|
||||
@ -169,15 +168,6 @@ proc_can_be_signalled (_pinfo *p)
|
||||
{
|
||||
if (!(p->exitcode & EXITCODE_SET))
|
||||
{
|
||||
if (p == myself_nowait || p == myself)
|
||||
if (hwait_sig)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
set_errno (EAGAIN);
|
||||
return hwait_sig;
|
||||
}
|
||||
|
||||
if (ISSTATE (p, PID_INITIALIZING) ||
|
||||
(((p)->process_state & (PID_ACTIVE | PID_IN_USE)) ==
|
||||
(PID_ACTIVE | PID_IN_USE)))
|
||||
@ -487,7 +477,8 @@ sigproc_init ()
|
||||
*/
|
||||
sync_proc_subproc.init ("sync_proc_subproc");
|
||||
|
||||
hwait_sig = new cygthread (wait_sig, cygself, "sig");
|
||||
my_sendsig = INVALID_HANDLE_VALUE; // changed later
|
||||
cygthread *hwait_sig = new cygthread (wait_sig, cygself, "sig");
|
||||
hwait_sig->zap_h ();
|
||||
|
||||
global_sigs[SIGSTOP].sa_flags = SA_RESTART | SA_NODEFER;
|
||||
@ -550,10 +541,10 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (no_signals_available ())
|
||||
if (!my_sendsig || (si.si_signo != __SIGEXIT && myself->exitcode & EXITCODE_SET) || &_my_tls == _sig_tls)
|
||||
{
|
||||
sigproc_printf ("hwait_sig %p, myself->sendsig %p, exit_state %d",
|
||||
hwait_sig, myself->sendsig, exit_state);
|
||||
sigproc_printf ("my_sendsig %p, myself->sendsig %p, exit_state %d",
|
||||
my_sendsig, myself->sendsig, exit_state);
|
||||
set_errno (EAGAIN);
|
||||
goto out; // Either exiting or not yet initializing
|
||||
}
|
||||
@ -647,7 +638,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (no_signals_available ())
|
||||
if (no_signals_available (si.si_signo != __SIGEXIT))
|
||||
sigproc_printf ("I'm going away now");
|
||||
else if (!p->exec_sendsig)
|
||||
system_printf ("error sending signal %d to pid %d, pipe handle %p, %E",
|
||||
@ -688,7 +679,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
||||
rc = 0; // Successful exit
|
||||
else
|
||||
{
|
||||
if (!no_signals_available ())
|
||||
if (!no_signals_available (true))
|
||||
system_printf ("wait for sig_complete event failed, signal %d, rc %d, %E",
|
||||
si.si_signo, rc);
|
||||
set_errno (ENOSYS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user