public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Brown <kbrown@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: FIFO: code simplifications.
Date: Thu, 09 May 2019 18:52:00 -0000	[thread overview]
Message-ID: <20190509185255.103416.qmail@sourceware.org> (raw)

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

commit e91bc190ff685bca726024da353f0921660bc863
Author: Ken Brown <kbrown@cornell.edu>
Date:   Thu May 9 12:35:58 2019 -0400

    Cygwin: FIFO: code simplifications.
    
    There's no longer a need to consider the connect_evt after fork/exec.
    After stopping the listen_client thread, all client handlers should be
    in the fc_connected or fc_invalid states, so their connect_evt members
    won't be used again.
    
    Also remove code in fhandler_fifo::dup that just repeats things
    already done in stop_listen_client.

Diff:
---
 winsup/cygwin/fhandler_fifo.cc | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index dab7df9..3fabbc3 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -966,9 +966,6 @@ fhandler_fifo::dup (fhandler_base *child, int flags)
 	  goto out;
 	}
     }
-  fhf->listen_client_thr = NULL;
-  fhf->lct_termination_evt = NULL;
-  fhf->fifo_client_unlock ();
   if (!reader || fhf->listen_client ())
     ret = 0;
   if (reader)
@@ -990,10 +987,7 @@ fhandler_fifo::fixup_after_fork (HANDLE parent)
   fork_fixup (parent, read_ready, "read_ready");
   fork_fixup (parent, write_ready, "write_ready");
   for (int i = 0; i < nhandlers; i++)
-    {
-      fc_handler[i].fh->fhandler_base::fixup_after_fork (parent);
-      fork_fixup (parent, fc_handler[i].connect_evt, "connect_evt");
-    }
+    fc_handler[i].fh->fhandler_base::fixup_after_fork (parent);
   if (reader && !listen_client ())
     debug_printf ("failed to start lct, %E");
 }
@@ -1013,8 +1007,5 @@ fhandler_fifo::set_close_on_exec (bool val)
   set_no_inheritance (read_ready, val);
   set_no_inheritance (write_ready, val);
   for (int i = 0; i < nhandlers; i++)
-    {
-      fc_handler[i].fh->fhandler_base::set_close_on_exec (val);
-      set_no_inheritance (fc_handler[i].connect_evt, val);
-    }
+    fc_handler[i].fh->fhandler_base::set_close_on_exec (val);
 }


                 reply	other threads:[~2019-05-09 18:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190509185255.103416.qmail@sourceware.org \
    --to=kbrown@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).