diff options
author | Christopher Faylor <me@cgf.cx> | 2012-06-18 00:50:24 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-06-18 00:50:24 +0400 |
commit | 4ae63783821bd2114246166957d25b2acd26c875 (patch) | |
tree | 0b7972e9330fa3a3f863621afd18643e485a151f /winsup/cygwin/fhandler_fifo.cc | |
parent | d66ef282c2473d7df911e6d7d6ef1fc778777097 (diff) |
Add '#include "cygwait.h"' throughout, where appropriate.
* DevNotes: Add entry cgf-000012.
* Makefile.in (DLL_OFILES): Add cygwait.o.
* sigproc.h: Remove cygwait definitions.
* cygwait.h: New file. Define/declare Cygwin waitfor functions.
* cygwait.cc: Ditto.
* exceptions.cc: Include cygwait.h.
(handle_sigsuspend): Accommodate change in cancelable_wait arguments.
(sigpacket::process): Display thread tls in debugging output.
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic names
for signal and cancel return.
* fhandler_console.cc (fhandler_console::read): Ditto.
(fhandler_dev_dsp::Audio_out::waitforspace): Ditto.
fhandler_dev_dsp::Audio_in::waitfordata): Ditto.
* fhandler_fifo.cc (fhandler_fifo::wait): Ditto.
* fhandler_serial.cc (fhandler_serial::raw_read): Ditto.
* fhandler_tty.cc (fhandler_pty_slave::read): Ditto.
* select.cc (cygwin_select): Ditto.
* wait.cc (wait4): Ditto.
* thread.cc (cancelable_wait): Move definition to cygwait.h.
(pthread_cond::wait): Accommodate change in cancelable_wait arguments.
(pthread_mutex::lock): Ditto.
(pthread_spinlock::lock): Ditto.
(pthread::join): Ditto.
(pthread::thread_init_wrapper): Display tls in debugging output.
(semaphore::_timedwait): Ditto.
* thread.h (cw_sig_wait): Move to cygwait.h.
(cw_cancel_action): Delete.
(cancelable_wait): Move declaration to cygwait.h.
Diffstat (limited to 'winsup/cygwin/fhandler_fifo.cc')
-rw-r--r-- | winsup/cygwin/fhandler_fifo.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index 0e2d2bde4..d2b236d5c 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -22,6 +22,7 @@ #include "cygtls.h" #include "shared_info.h" #include "ntdll.h" +#include "cygwait.h" fhandler_fifo::fhandler_fifo (): fhandler_base_overlapped (), @@ -242,6 +243,14 @@ fhandler_fifo::wait (HANDLE h) case WAIT_OBJECT_0: debug_only_printf ("successfully waited for %s", what); return true; + case WAIT_SIGNALED: + debug_only_printf ("interrupted by signal while waiting for %s", what); + set_errno (EINTR); + return false; + case WAIT_CANCELED: + debug_only_printf ("cancellable interruption while waiting for %s", what); + pthread::static_cancel_self (); /* never returns */ + break; case WAIT_TIMEOUT: if (h == write_ready) { @@ -254,14 +263,6 @@ fhandler_fifo::wait (HANDLE h) return false; } break; - case WAIT_OBJECT_0 + 1: - debug_only_printf ("interrupted by signal while waiting for %s", what); - set_errno (EINTR); - return false; - case WAIT_OBJECT_0 + 2: - debug_only_printf ("cancellable interruption while waiting for %s", what); - pthread::static_cancel_self (); /* never returns */ - break; default: debug_only_printf ("unknown error while waiting for %s", what); __seterrno (); |