From a6a987c0de8d7eccf7048a6d768ea88fd7fac449 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 5 Aug 2024 16:32:31 -0400 Subject: [PATCH] win,signal: fix data race dispatching SIGWINCH (#4488) The Event should be reset before reading the value, or libuv might miss an update that occurred too rapidly after the previously one. Refs: https://github.com/libuv/libuv/pull/2381 Refs: https://github.com/libuv/libuv/discussions/4485 --- src/win/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/tty.c b/src/win/tty.c index f9e33469..c0339ded 100644 --- a/src/win/tty.c +++ b/src/win/tty.c @@ -2380,8 +2380,8 @@ static DWORD WINAPI uv__tty_console_resize_watcher_thread(void* param) { /* Make sure to not overwhelm the system with resize events */ Sleep(33); WaitForSingleObject(uv__tty_console_resized, INFINITE); - uv__tty_console_signal_resize(); ResetEvent(uv__tty_console_resized); + uv__tty_console_signal_resize(); } return 0; }