https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6d46d8504948b365cd5365e0f62f855f98773031
commit 6d46d8504948b365cd5365e0f62f855f98773031 Author: Takashi Yano <[email protected]> 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);
