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:
Corinna Vinschen
2019-01-14 17:19:37 +01:00
parent 752151e715
commit f42776fa78
9 changed files with 129 additions and 33 deletions

View File

@ -2651,6 +2651,7 @@ class fhandler_signalfd : public fhandler_base
void __reg3 read (void *ptr, size_t& len);
int poll ();
inline sigset_t get_sigset () const { return sigset; }
select_record *select_read (select_stuff *);
select_record *select_write (select_stuff *);