diff options
author | Christopher Faylor <me@cgf.cx> | 2004-06-07 04:26:32 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-06-07 04:26:32 +0000 |
commit | beffbc5efd36a3103c1c8b27202c9d97621f961b (patch) | |
tree | 38af781c06db587a1052db27b8cefef005a6f9d9 /winsup/cygwin/thread.cc | |
parent | 6a02213b528eaac0c0955ede85ca2e4867b96e46 (diff) | |
download | cygnal-beffbc5efd36a3103c1c8b27202c9d97621f961b.tar.gz cygnal-beffbc5efd36a3103c1c8b27202c9d97621f961b.tar.bz2 cygnal-beffbc5efd36a3103c1c8b27202c9d97621f961b.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r-- | winsup/cygwin/thread.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 4cac624b8..a248b2604 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -178,9 +178,8 @@ pthread::init_mainthread () set_tls_self_pointer (thread); thread->thread_id = GetCurrentThreadId (); - if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), - GetCurrentProcess (), &thread->win32_obj_id, - 0, FALSE, DUPLICATE_SAME_ACCESS)) + if (!DuplicateHandle (hMainProc, GetCurrentThread (), hMainProc, + &thread->win32_obj_id, 0, FALSE, DUPLICATE_SAME_ACCESS)) api_fatal ("failed to create mainthread handle"); if (!thread->create_cancel_event ()) api_fatal ("couldn't create cancel event for main thread"); |