Cygwin: signalfd: implement non-polling select
Allow the signal thread to recognize we're called in consequence of select on a signalfd. If the signal is part of the wait mask, don't call any signal handler and don't remove the signal from the queue, so a subsequent read (or sigwaitinfo/sigtimedwait) still gets the signal. Instead, just signal the event object at _cygtls::signalfd_select_wait for the thread running select. The addition of signalfd_select_wait to _cygtls unearthed the alignment problem of the context member again. To make sure this doesn't get lost, improve the related comment in the header file so that this (hopefully) doesn't get lost (again). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -140,10 +140,10 @@ fhandler_signalfd::read (void *ptr, size_t& len)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Called from select */
|
||||
int
|
||||
fhandler_signalfd::poll ()
|
||||
{
|
||||
Sleep (1L); /* BAD HACK, FIXME, need a non-polling technique. */
|
||||
sigset_t outset = (sigset_t) sig_send (myself, __SIGPENDING, &_my_tls);
|
||||
if (outset == SIG_BAD_MASK)
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user