public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pty: Add missing guard for close_pseudoconsole().
@ 2021-04-21 15:43 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-04-21 15:43 UTC (permalink / raw)
  To: cygwin-cvs

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

commit 6d46d8504948b365cd5365e0f62f855f98773031
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Wed Apr 21 12:07:31 2021 +0900

    Cygwin: pty: Add missing guard for close_pseudoconsole().
    
    - This patch adds a missing mutex guard for close_pseudoconsole()
      call when GDB exits.

Diff:
---
 winsup/cygwin/fhandler_tty.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 530321513..9c03e09a7 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -177,7 +177,9 @@ atexit_func (void)
 						    input_available_event);
 		ReleaseMutex (ptys->input_mutex);
 	      }
+	    WaitForSingleObject (ptys->pcon_mutex, INFINITE);
 	    ptys->close_pseudoconsole (ttyp, force_switch_to);
+	    ReleaseMutex (ptys->pcon_mutex);
 	    break;
 	  }
       CloseHandle (h_gdb_process);


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

only message in thread, other threads:[~2021-04-21 15:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 15:43 [newlib-cygwin] Cygwin: pty: Add missing guard for close_pseudoconsole() 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).