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

@@ -29,10 +29,10 @@
//; $tls::psigwait_info = 2852;
//; $tls::signal_arrived = -9844;
//; $tls::psignal_arrived = 2856;
//; $tls::signalfd_select_wait = -9840;
//; $tls::psignalfd_select_wait = 2860;
//; $tls::will_wait_for_signal = -9836;
//; $tls::pwill_wait_for_signal = 2864;
//; $tls::will_wait_for_signal = -9840;
//; $tls::pwill_wait_for_signal = 2860;
//; $tls::__align = -9836;
//; $tls::p__align = 2864;
//; $tls::context = -9832;
//; $tls::pcontext = 2868;
//; $tls::thread_id = -9084;
@@ -91,10 +91,10 @@
#define tls_psigwait_info (2852)
#define tls_signal_arrived (-9844)
#define tls_psignal_arrived (2856)
#define tls_signalfd_select_wait (-9840)
#define tls_psignalfd_select_wait (2860)
#define tls_will_wait_for_signal (-9836)
#define tls_pwill_wait_for_signal (2864)
#define tls_will_wait_for_signal (-9840)
#define tls_pwill_wait_for_signal (2860)
#define tls___align (-9836)
#define tls_p__align (2864)
#define tls_context (-9832)
#define tls_pcontext (2868)
#define tls_thread_id (-9084)