diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-04-24 01:48:11 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-27 11:54:37 +0200 |
commit | f25123df6633803e9a69b912b12aa302150a979b (patch) | |
tree | cacac39ad7b3d305c1f256664ca4f3329851801a /Userland/Libraries/LibCore/EventLoop.h | |
parent | 9e2a619fdcf7e232c1fd1d6ade9bbe88b810c0f8 (diff) | |
download | serenity-f25123df6633803e9a69b912b12aa302150a979b.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibCore/EventLoop.h')
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index 64350b99d8..0599944489 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -26,8 +26,6 @@ namespace Core { -extern Threading::MutexProtected<EventLoop*> s_main_event_loop; - class EventLoop { public: enum class MakeInspectable { @@ -59,14 +57,6 @@ public: void post_event(Object& receiver, NonnullOwnPtr<Event>&&, ShouldWake = ShouldWake::No); - template<typename Callback> - static decltype(auto) with_main_locked(Callback callback) - { - return s_main_event_loop.with_locked([&callback](auto*& event_loop) { - VERIFY(event_loop != nullptr); - return callback(event_loop); - }); - } static EventLoop& current(); bool was_exit_requested() const { return m_exit_requested; } |