diff options
author | Christopher Faylor <me@cgf.cx> | 2002-08-02 02:10:24 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-08-02 02:10:24 +0000 |
commit | 6b2a9a2fdf2a62475c7bb7ff3ef49eee5b82fa6e (patch) | |
tree | 11e02150f990347628c418296d1344740b7ac689 /winsup/cygwin/syscalls.cc | |
parent | 8a19897f17594f47d2c4cc78bae466e9c54dc1e1 (diff) | |
download | cygnal-6b2a9a2fdf2a62475c7bb7ff3ef49eee5b82fa6e.tar.gz cygnal-6b2a9a2fdf2a62475c7bb7ff3ef49eee5b82fa6e.tar.bz2 cygnal-6b2a9a2fdf2a62475c7bb7ff3ef49eee5b82fa6e.zip |
* cygthread.cc (cygthread::exit_thread): Define new method.
* cygthread.h (cygthread::exit_thread): Declare new method.
* fhandler.h (fhandler_tty_master::hThread): Delete.
(fhandler_tty_master::output_thread): Define.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
constructor.
(fhandler_tty_master::init): Use cygthread rather than handle.
(process_output): Use cygthread method to exit.
(fhandler_tty_master::fixup_after_fork): Set output_thread to NULL after fork.
(fhandler_tty_master::fixup_after_exec): Set output_thread to NULL after
spawn/exec.
* tty.cc (tty_list::terminate): Detach from output_thread using cygthread
method.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index a9c9d53c5..4792744e0 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -305,10 +305,11 @@ _read (int fd, void *ptr, size_t len) DWORD wait = cfd->is_nonblocking () ? 0 : INFINITE; /* Could block, so let user know we at least got here. */ - syscall_printf ("read (%d, %p, %d) %sblocking, sigcatchers %d", fd, ptr, len, wait ? "" : "non", sigcatchers); + syscall_printf ("read (%d, %p, %d) %sblocking, sigcatchers %d", + fd, ptr, len, wait ? "" : "non", sigcatchers); if (wait && (!cfd->is_slow () || cfd->get_r_no_interrupt ())) - debug_printf ("non-interruptible read\n"); + debug_printf ("no need to call ready_for_read\n"); else if (!cfd->ready_for_read (fd, wait)) { res = -1; @@ -318,7 +319,7 @@ _read (int fd, void *ptr, size_t len) /* FIXME: This is not thread safe. We need some method to ensure that an fd, closed in another thread, aborts I/O operations. */ - if (!cfd.isopen()) + if (!cfd.isopen ()) return -1; /* Check to see if this is a background read from a "tty", @@ -331,7 +332,7 @@ _read (int fd, void *ptr, size_t len) if (res > bg_eof) { myself->process_state |= PID_TTYIN; - if (!cfd.isopen()) + if (!cfd.isopen ()) return -1; res = cfd->read (ptr, len); myself->process_state &= ~PID_TTYIN; |