* 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

@@ -37,6 +37,7 @@ details. */
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
#include "ntdll.h"
extern "C" void __fp_lock_all ();
extern "C" void __fp_unlock_all ();
@@ -742,7 +743,7 @@ pthread::testcancel ()
if (cancelstate == PTHREAD_CANCEL_DISABLE)
return;
if (WaitForSingleObject (cancel_event, 0) == WAIT_OBJECT_0)
if (IsEventSignalled (cancel_event))
cancel_self ();
}