* cygtls.h (_cygtls::create_signal_arrived): New function.
(_cygtls::set_signal_arrived): Lock creation of signal_arrived. * cygwait.cc (cancelable_wait): Ignore signal_arrived event if _my_tls 'sig' element does not exist. * exceptions.cc (_cygtls::interrupt_setup): Create signal_arrived if recipient thread has not created it.
This commit is contained in:
@ -79,10 +79,18 @@ cancelable_wait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask)
|
||||
res = WAIT_TIMEOUT;
|
||||
else if (res != sig_n)
|
||||
/* all set */;
|
||||
else if (is_cw_sig_eintr)
|
||||
res = WAIT_SIGNALED; /* caller will deal with signals */
|
||||
else if (_my_tls.call_signal_handler ())
|
||||
continue;
|
||||
else
|
||||
{
|
||||
_my_tls.lock ();
|
||||
int sig = _my_tls.sig;
|
||||
_my_tls.unlock ();
|
||||
if (!sig)
|
||||
continue;
|
||||
if (is_cw_sig_eintr)
|
||||
res = WAIT_SIGNALED; /* caller will deal with signals */
|
||||
else if (_my_tls.call_signal_handler ())
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user