public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: select: Fix a bug on closing pi->bye event.
@ 2020-08-27  9:46 Takashi Yano
  2020-08-28 13:25 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Yano @ 2020-08-27  9:46 UTC (permalink / raw)
  To: cygwin-patches

- Close event handle pi->bye only if it was created.
  Addresses:
  https://cygwin.com/pipermail/cygwin-developers/2020-August/011948.html
---
 winsup/cygwin/select.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 9f1a8a57a..501714fa7 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -783,8 +783,8 @@ pipe_cleanup (select_record *, select_stuff *stuff)
       pi->stop_thread = true;
       SetEvent (pi->bye);
       pi->thread->detach ();
+      CloseHandle (pi->bye);
     }
-  CloseHandle (pi->bye);
   delete pi;
   stuff->device_specific_pipe = NULL;
 }
@@ -978,8 +978,8 @@ fifo_cleanup (select_record *, select_stuff *stuff)
       pi->stop_thread = true;
       SetEvent (pi->bye);
       pi->thread->detach ();
+      CloseHandle (pi->bye);
     }
-  CloseHandle (pi->bye);
   delete pi;
   stuff->device_specific_fifo = NULL;
 }
@@ -1344,8 +1344,8 @@ pty_slave_cleanup (select_record *me, select_stuff *stuff)
       pi->stop_thread = true;
       SetEvent (pi->bye);
       pi->thread->detach ();
+      CloseHandle (pi->bye);
     }
-  CloseHandle (pi->bye);
   delete pi;
   stuff->device_specific_ptys = NULL;
 }
-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Cygwin: select: Fix a bug on closing pi->bye event.
  2020-08-27  9:46 [PATCH] Cygwin: select: Fix a bug on closing pi->bye event Takashi Yano
@ 2020-08-28 13:25 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2020-08-28 13:25 UTC (permalink / raw)
  To: cygwin-patches

On Aug 27 18:46, Takashi Yano via Cygwin-patches wrote:
> - Close event handle pi->bye only if it was created.
>   Addresses:
>   https://cygwin.com/pipermail/cygwin-developers/2020-August/011948.html
> ---
>  winsup/cygwin/select.cc | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Pushed.


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-28 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27  9:46 [PATCH] Cygwin: select: Fix a bug on closing pi->bye event Takashi Yano
2020-08-28 13:25 ` Corinna Vinschen

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).