aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2021-04-21 12:07:31 +0900
committerCorinna Vinschen <corinna@vinschen.de>2021-04-21 17:42:00 +0200
commit6d46d8504948b365cd5365e0f62f855f98773031 (patch)
tree57eb551a576489b9b83572f770790ece27ca9a8d
parent6004ea977bb33b1ecd49a213f04c8657be3d7b3f (diff)
downloadnewlib-6d46d8504948b365cd5365e0f62f855f98773031.zip
newlib-6d46d8504948b365cd5365e0f62f855f98773031.tar.gz
newlib-6d46d8504948b365cd5365e0f62f855f98773031.tar.bz2
Cygwin: pty: Add missing guard for close_pseudoconsole().
- This patch adds a missing mutex guard for close_pseudoconsole() call when GDB exits.
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5303215..9c03e09 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);