* 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:
@ -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;
|
||||
|
Reference in New Issue
Block a user