public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: FIFO: restart listen_client thread after fork/exec
@ 2019-04-23 12:17 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2019-04-23 12:17 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9957a7895be652b502f53811e581d923f93c135f

commit 9957a7895be652b502f53811e581d923f93c135f
Author: Ken Brown <kbrown@cornell.edu>
Date:   Sat Apr 20 11:46:09 2019 -0400

    Cygwin: FIFO: restart listen_client thread after fork/exec
    
    This allows writers to connect immediately.  Previously the lct wasn't
    restarted until the reader attempted to read.

Diff:
---
 winsup/cygwin/fhandler_fifo.cc | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 9b94a6d..ac2196c 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -755,7 +755,7 @@ fhandler_fifo::raw_read (void *in_ptr, size_t& len)
 {
   size_t orig_len = len;
 
-  /* Start the listen_client thread if necessary (e.g., after fork or exec). */
+  /* Start the listen_client thread if necessary (shouldn't be). */
   if (!listen_client_thr && !listen_client ())
     goto errout;
 
@@ -960,18 +960,16 @@ fhandler_fifo::fixup_after_fork (HANDLE parent)
       fc_handler[i].fh->fhandler_base::fixup_after_fork (parent);
       fork_fixup (parent, fc_handler[i].connect_evt, "connect_evt");
     }
-  listen_client_thr = NULL;
-  lct_termination_evt = NULL;
-  fifo_client_unlock ();
+  if (reader && !listen_client ())
+    debug_printf ("failed to start lct, %E");
 }
 
 void
 fhandler_fifo::fixup_after_exec ()
 {
   fhandler_base::fixup_after_exec ();
-  listen_client_thr = NULL;
-  lct_termination_evt = NULL;
-  fifo_client_unlock ();
+  if (reader && !listen_client ())
+    debug_printf ("failed to start lct, %E");
 }
 
 void


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-23 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 12:17 [newlib-cygwin] Cygwin: FIFO: restart listen_client thread after fork/exec Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).