Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-06-07 08:26:32 +0400
committerChristopher Faylor <me@cgf.cx>2004-06-07 08:26:32 +0400
commitbeffbc5efd36a3103c1c8b27202c9d97621f961b (patch)
tree38af781c06db587a1052db27b8cefef005a6f9d9 /winsup/cygwin/dtable.cc
parent6a02213b528eaac0c0955ede85ca2e4867b96e46 (diff)
* 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/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 532910410..c9f0cde7e 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -557,13 +557,18 @@ fhandler_fifo *
dtable::find_fifo (const char *path)
{
lock ();
+ fhandler_fifo *fh_res = NULL;
for (unsigned i = 0; i < size; i++)
{
fhandler_base *fh = fds[i];
if (fh && fh->isfifo () && strcmp (path, fh->get_win32_name ()) == 0)
- return (fhandler_fifo *) fh;
+ {
+ fh_res = (fhandler_fifo *) fh;
+ break;
+ }
}
- return NULL;
+ unlock ();
+ return fh_res;
}
select_record *