mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
* 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:
parent
f432e328af
commit
211dd84b83
@ -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>
|
2013-01-16 Christopher Faylor <me.cygwin2013@cgf.cx>
|
||||||
|
|
||||||
* pthread.cc (pthread_exit): Add kludge to accommodate noreturn attribute.
|
* pthread.cc (pthread_exit): Add kludge to accommodate noreturn attribute.
|
||||||
|
@ -31,8 +31,6 @@ details. */
|
|||||||
#define WSSC 60000 // Wait for signal completion
|
#define WSSC 60000 // Wait for signal completion
|
||||||
#define WPSP 40000 // Wait for proc_subproc mutex
|
#define WPSP 40000 // Wait for proc_subproc mutex
|
||||||
|
|
||||||
#define no_signals_available() ((myself->exitcode & EXITCODE_SET) || (&_my_tls == _sig_tls))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
@ -489,6 +487,7 @@ exit_thread (DWORD res)
|
|||||||
#ifdef DEBUGGING
|
#ifdef DEBUGGING
|
||||||
system_printf ("couldn't duplicate the current thread, %E");
|
system_printf ("couldn't duplicate the current thread, %E");
|
||||||
#endif
|
#endif
|
||||||
|
for_now.release ();
|
||||||
ExitThread (res);
|
ExitThread (res);
|
||||||
}
|
}
|
||||||
ProtectHandle1 (h, exit_thread);
|
ProtectHandle1 (h, exit_thread);
|
||||||
@ -543,7 +542,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
|||||||
|
|
||||||
pack.wakeup = NULL;
|
pack.wakeup = NULL;
|
||||||
bool wait_for_completion;
|
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
|
/* It is possible that the process is not yet ready to receive messages
|
||||||
* or that it has exited. Detect this.
|
* or that it has exited. Detect this.
|
||||||
@ -558,11 +557,6 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (no_signals_available ())
|
|
||||||
{
|
|
||||||
set_errno (EAGAIN);
|
|
||||||
goto out; // Either exiting or not yet initializing
|
|
||||||
}
|
|
||||||
wait_for_completion = p != myself_nowait;
|
wait_for_completion = p != myself_nowait;
|
||||||
p = myself;
|
p = myself;
|
||||||
}
|
}
|
||||||
@ -688,9 +682,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (no_signals_available ())
|
if (!p->exec_sendsig)
|
||||||
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",
|
system_printf ("error sending signal %d to pid %d, pipe handle %p, %E",
|
||||||
si.si_signo, p->pid, sendsig);
|
si.si_signo, p->pid, sendsig);
|
||||||
}
|
}
|
||||||
@ -728,9 +720,6 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
|
|||||||
rc = 0; // Successful exit
|
rc = 0; // Successful exit
|
||||||
else
|
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);
|
set_errno (ENOSYS);
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user