From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id BE88E395543D; Wed, 21 Apr 2021 15:43:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE88E395543D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pty: Add missing guard for close_pseudoconsole(). X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 6004ea977bb33b1ecd49a213f04c8657be3d7b3f X-Git-Newrev: 6d46d8504948b365cd5365e0f62f855f98773031 Message-Id: <20210421154355.BE88E395543D@sourceware.org> Date: Wed, 21 Apr 2021 15:43:55 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 15:43:55 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6d46d8504948b365cd5365e0f62f855f98773031 commit 6d46d8504948b365cd5365e0f62f855f98773031 Author: Takashi Yano 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);