* fhandler.h (fhandler_base::has_ongoing_io): Declare new function.

* fhandler.cc (fhandler_base::has_ongoing_io): Define new function.
(fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing when
handle has not completed last I/O.
(fhandler_base::write_overlapped): Ditto.
* select.cc (peek_pipe): Be more careful about accessing hEvent field from
get_overlapped().
This commit is contained in:
Christopher Faylor
2009-06-28 19:23:13 +00:00
parent 91000b5d66
commit c81ceaefec
4 changed files with 60 additions and 19 deletions

View File

@ -302,6 +302,7 @@ class fhandler_base
virtual char const *ttyname () { return get_name (); }
virtual void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
virtual void __stdcall read_overlapped (void *ptr, size_t& len) __attribute__ ((regparm (3)));
virtual bool __stdcall has_ongoing_io () __attribute__ ((regparm (1)));
virtual int write (const void *ptr, size_t len);
virtual int __stdcall write_overlapped (const void *ptr, size_t len);
virtual ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1);