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
This commit is contained in:
Jameson Nash 2024-08-05 16:32:31 -04:00 committed by GitHub
parent 727ee7237e
commit a6a987c0de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}