Daniel Colascione
2011-12-18 00:03:26 UTC
CVSROOT: /cvs/uberbaum
Module name: winsup
Changes by: cgf[SNIP] 2011-12-17 07:01:21
(fhandler_base_overlapped::close): Cancel any ongoing I/O before closing.
http://sourceware.org/cgi-bin/cvsweb.cgi/winsup/cygwin/fhandler.cc.diff?cvsroot=uberbaum&r1=1.418&r2=1.419
+ /* Cancelling seems to be necessary for cases where a reader isModule name: winsup
Changes by: cgf[SNIP] 2011-12-17 07:01:21
(fhandler_base_overlapped::close): Cancel any ongoing I/O before closing.
http://sourceware.org/cgi-bin/cvsweb.cgi/winsup/cygwin/fhandler.cc.diff?cvsroot=uberbaum&r1=1.418&r2=1.419
+ still executing either in another thread or when a signal handler
^^^^^^^^^ ^^^^^^^^^^^^^^^^^
+ performs a close. */
+ CancelIo (get_io_handle ());
Cancels all pending input and output (I/O) operations that are
issued by the calling thread for the specified file. The function
^^^^^^^^^^^^^^^^^^^^^issued by the calling thread for the specified file. The function
does not cancel I/O operations that other threads issue for a file handle.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^I think you want to call CancelIoEx here, passing NULL for its second parameter.
CancelIoEx, however, is only available post-Vista, so I imagine you'd want to
fall back to CancelIo for XP, accepting that you can't cancel IO from another
thread, and that the mechanism will work only from a signal delivered to the
thread doing the IO.