From a6d06056e17ef81a13081f58710e56e4f964a07e Mon Sep 17 00:00:00 2001 From: Takashi Yano Date: Mon, 9 May 2022 00:54:35 +0900 Subject: [PATCH] Cygwin: pty: Add missing attach_mutex guard. --- 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 f6a7a6cf9..bb18d139e 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -3422,6 +3422,7 @@ skip_create: HeapFree (GetProcessHeap (), 0, hp); } + acquire_attach_mutex (mutex_timeout); if (get_ttyp ()->previous_code_page) SetConsoleCP (get_ttyp ()->previous_code_page); if (get_ttyp ()->previous_output_code_page) @@ -3452,6 +3453,7 @@ skip_create: mode |= DISABLE_NEWLINE_AUTO_RETURN; SetConsoleMode (hpConOut, mode); } + release_attach_mutex (); return true;