LibCore: Restore single-shot timer objects manual reset on Windows

The initial IOCP event loop implementation removed the single shot
timer fix added in 0005207 was removed.

Adding this back allowed simple web pages like https://ladybird.org/ to
be loaded again.
This commit is contained in:
ayeteadoe
2025-11-17 13:19:35 -08:00
committed by Jelle Raaijmakers
parent 11b8bbeadf
commit 540bbae480
Notes: github-actions[bot] 2025-11-18 17:50:55 +00:00

View File

@@ -288,9 +288,14 @@ intptr_t EventLoopManagerWindows::register_timer(EventReceiver& object, int mill
VERIFY(thread_data);
auto& timers = thread_data->timers;
// FIXME: This is a temporary fix for issue #3641
bool manual_reset = static_cast<Timer&>(object).is_single_shot();
HANDLE timer = CreateWaitableTimer(NULL, manual_reset, NULL);
VERIFY(timer);
auto timer_data = make<EventLoopTimer>();
timer_data->type = CompletionType::Timer;
timer_data->timer.handle = CreateWaitableTimer(NULL, FALSE, NULL);
timer_data->timer.handle = timer;
timer_data->owner = object.make_weak_ptr();
timer_data->is_periodic = should_reload;
VERIFY(timer_data->timer.handle);