mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibCore: Remove main event loop
The main event loop functionality was used in just two places where the alternative is a bit simpler. Remove it in favor of referencing the event loop directly, or just invoking `EventLoop::current()`. Note that we don't need locking in the constructor since we're now only modifying a thread-local `Vector`. We also don't need locking in the old call sites to `::with_main_locked()` since we already lock the event loop in the subsequent `::post_event()` invocation.
This commit is contained in:
committed by
Linus Groh
parent
9e2a619fdc
commit
f25123df66
Notes:
sideshowbarker
2024-07-17 11:30:10 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/f25123df66 Pull-request: https://github.com/SerenityOS/serenity/pull/13784 Reviewed-by: https://github.com/linusg
@@ -123,7 +123,7 @@ void ThreadStackWidget::refresh()
|
||||
[weak_this = make_weak_ptr()](auto result) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
Core::EventLoop::with_main_locked([&](auto* main_event_loop) { main_event_loop->post_event(const_cast<Core::Object&>(*weak_this), make<CompletionEvent>(move(result))); });
|
||||
Core::EventLoop::current().post_event(const_cast<Core::Object&>(*weak_this), make<CompletionEvent>(move(result)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user