* 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:
Christopher Faylor
2012-08-15 18:50:44 +00:00
parent 588b40e260
commit 879f3ad5ee
4 changed files with 36 additions and 7 deletions

View File

@ -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;
}