* ntdll.h (IsEventSignalled): New inline function.

* cygthread.cc (cygthread::terminate_thread): Use IsEventSignalled in
	place of WaitForSingleObject on event with 0 timeout.
	* fhandler.cc (fhandler_base_overlapped::has_ongoing_io): Ditto.
	* fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto.
	(fhandler_fifo::wait): Ditto.
	* fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
	* select.cc (verify_tty_slave): Ditto.
	* thread.cc (pthread::testcancel): Ditto.
This commit is contained in:
Corinna Vinschen
2011-04-29 08:27:11 +00:00
parent 12eac211c9
commit bd139e52b4
8 changed files with 36 additions and 8 deletions

View File

@ -21,6 +21,7 @@
#include "sigproc.h"
#include "cygtls.h"
#include "shared_info.h"
#include "ntdll.h"
fhandler_fifo::fhandler_fifo ():
fhandler_base_overlapped (), wait_state (fifo_unknown), dummy_client (NULL)
@ -48,7 +49,7 @@ fhandler_fifo::open_nonserver (const char *npname, unsigned low_flags,
return h;
if (&_my_tls != _main_tls)
yield ();
else if (WaitForSingleObject (signal_arrived, 0) == WAIT_OBJECT_0)
else if (IsEventSignalled (signal_arrived))
{
set_errno (EINTR);
return NULL;
@ -224,7 +225,7 @@ fhandler_fifo::wait (bool iswrite)
__seterrno ();
return false;
}
else if (WaitForSingleObject (signal_arrived, 0) != WAIT_OBJECT_0)
else if (!IsEventSignalled (signal_arrived))
continue;
else if (_my_tls.call_signal_handler ())
continue;