From: "Haidong Yu" Subject: [PATCH v2] conhost: Input should be restored and input_thread handle should be closed before return. Message-Id: <360affc9.166e.174b89e892a.Coremail.yhd986@163.com> Date: Wed, 23 Sep 2020 09:40:31 +0800 (CST) From fe543e0c11ea8c5c7ab81e2b55e9a83c9bbf455d Mon Sep 17 00:00:00 2001 From: Haidong Yu Date: Wed, 23 Sep 2020 09:31:43 +0800 Subject: [PATCH v2] conhost: Input should be restored and input_thread handle should be closed before return. Signed-off-by: Haidong Yu --- programs/conhost/conhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index a775e74961..79cbb8e83a 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1652,7 +1652,7 @@ static DWORD WINAPI tty_input( void *param ) { case 3: /* end of text */ LeaveCriticalSection( &console_section ); - return 0; + goto done; case '\n': key_press( console, '\n', VK_RETURN, LEFT_CTRL_PRESSED ); break; @@ -1681,6 +1681,7 @@ static DWORD WINAPI tty_input( void *param ) TRACE( "NtReadFile failed: %#x\n", status ); +done: EnterCriticalSection( &console_section ); if (console->read_ioctl) read_complete( console, status, NULL, 0, FALSE ); if (console->is_unix) -- 2.20.1