From beffbc5efd36a3103c1c8b27202c9d97621f961b Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 7 Jun 2004 04:26:32 +0000 Subject: * dtable.cc (dtable::find_fifo): Release lock after fifo found (still racy). * fhandler.h (fhandler_fifo::get_io_handle): New fifo-specific method. * fhandler_fifo.cc (fhandler_fifo::close): Close output_handle only if it is open. (fhandler_fifo::open_not_mine): Reorganize slightly. Don't call _pinfo methods when the fifo is owned by me or suffer dtable lock_cs deadlock. (fhandler_fifo::open): Call open_not_mine first, otherwise open myself (racy). * pinfo.cc (_pinfo::commune_recv): Duplicate fifo handles here in requesting processes arena to avoid one potential race (of many). (_pinfo::commune_send): Move all PICOM_FIFO code under one case statement. * thread.cc (pthread::init_mainthread) Use existing hMainProc handle rather than calling GetCurrentProcess. --- winsup/cygwin/fhandler.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 1e8129842..c5f99f07a 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -324,6 +324,7 @@ class fhandler_base bool is_fs_special () {return pc.is_fs_special ();} bool device_access_denied (int) __attribute__ ((regparm (2))); int fhaccess (int flags) __attribute__ ((regparm (2))); + friend class fhandler_fifo; }; class fhandler_socket: public fhandler_base @@ -454,6 +455,7 @@ class fhandler_fifo: public fhandler_pipe HANDLE owner; // You can't have too many mutexes, now, can you? long read_use; long write_use; + virtual HANDLE& get_io_handle () { return io_handle ?: output_handle; } public: fhandler_fifo (); int open (int flags, mode_t mode = 0); -- cgit v1.2.3