mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibCore: Don't wait in WaitForMultipleObjects if thread event queue
has pending events in EventLoopImplementationWindows This matches the behavior of the Linux version: https://github.com/LadybirdBrowser/ladybird/blob/911cd4aefd0c/Libraries/LibCore/EventLoopImplementationUnix.cpp#L371
This commit is contained in:
parent
33457f389d
commit
5ea4d26458
Notes:
github-actions[bot]
2025-04-11 01:03:21 +00:00
Author: https://github.com/stasoid Commit: https://github.com/LadybirdBrowser/ladybird/commit/5ea4d264580 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3188 Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 3 additions and 1 deletions
|
@ -112,7 +112,9 @@ size_t EventLoopImplementationWindows::pump(PumpMode)
|
|||
for (auto& entry : timers)
|
||||
event_handles.append(entry.key.handle);
|
||||
|
||||
DWORD result = WaitForMultipleObjects(event_count, event_handles.data(), FALSE, INFINITE);
|
||||
bool has_pending_events = ThreadEventQueue::current().has_pending_events();
|
||||
int timeout = has_pending_events ? 0 : INFINITE;
|
||||
DWORD result = WaitForMultipleObjects(event_count, event_handles.data(), FALSE, timeout);
|
||||
size_t index = result - WAIT_OBJECT_0;
|
||||
VERIFY(index < event_count);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue