Cygwin: select: revamp non-polling code for signalfd

Rather than waiting for signalfd_select_wait in a thread, which is racy,
create a global event "my_pendingsigs_evt" which is set and reset by
wait_sig depending only on the fact if blocked signals are pending or not.

This in turn allows to WFMO on this event in select as soon as signalfds
are present in the read descriptor set.  Select's peek and verify
will then check if one of the present signalfds is affected.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-08-16 16:36:06 +02:00
parent b7399d5e6f
commit 7097b05eda
8 changed files with 40 additions and 111 deletions

View File

@ -1469,14 +1469,6 @@ sigpacket::process ()
if (issig_wait)
{
tls->sigwait_mask = 0;
/* If the catching thread is running select on a signalfd, don't call
the signal handler and don't remove the signal from the queue. */
if (tls->signalfd_select_wait)
{
SetEvent (tls->signalfd_select_wait);
rc = 0;
goto done;
}
goto dosig;
}