* cygwait.h (enum cw_wait_mask): Add cw_sig_restart. Add comments

to explain the meaning of the possible values.
	* cygwait.cc (is_cw_sig_restart): Define.
	(is_cw_sig_handle): Check for cw_sig_restart as well.
	(cygwait): Restart always if cw_sig_restart is set.
	* thread.cc (pthread::join): Call cygwait with cw_sig_restart flag
	to avoid having to handle signals at all.
This commit is contained in:
Corinna Vinschen
2015-02-23 13:56:01 +00:00
parent b6e4adaaf1
commit 093fe9b598
4 changed files with 25 additions and 11 deletions

View File

@@ -18,8 +18,10 @@
#define is_cw_sig (mask & cw_sig)
#define is_cw_sig_eintr (mask & cw_sig_eintr)
#define is_cw_sig_cont (mask & cw_sig_cont)
#define is_cw_sig_restart (mask & cw_sig_restart)
#define is_cw_sig_handle (mask & (cw_sig | cw_sig_eintr | cw_sig_cont))
#define is_cw_sig_handle (mask & (cw_sig | cw_sig_eintr \
| cw_sig_cont | cw_sig_restart))
LARGE_INTEGER cw_nowait_storage;
@@ -88,7 +90,7 @@ cygwait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask)
continue;
if (is_cw_sig_eintr || (is_cw_sig_cont && sig == SIGCONT))
;
else if (_my_tls.call_signal_handler ())
else if (_my_tls.call_signal_handler () || is_cw_sig_restart)
continue;
res = WAIT_SIGNALED; /* caller will deal with signals */
}