diff options
author | Andreas Kling <kling@serenityos.org> | 2023-04-23 18:20:38 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-25 14:48:40 +0200 |
commit | 9601b516b81c70fb109ded5f0c9a038301c4f80e (patch) | |
tree | 210c6ed79ed42010132a5dadcacd0c0a4343dfb5 /Userland/Libraries/LibCore/EventLoop.h | |
parent | 896d1e4f42d30f90ce1c983c0b1c5e7bf9578fd1 (diff) | |
download | serenity-9601b516b81c70fb109ded5f0c9a038301c4f80e.zip |
LibCore: Remove awkward EventLoop::wake_once() API
This was used in exactly one place, to avoid sending multiple
CustomEvents to the enqueuer thread in Audio::ConnectionToServer.
Instead of this, we now just send a CustomEvent and wake the enqueuer
thread. If it wakes up and has multiple CustomEvents, they get delivered
and ignored in no time anyway. Since they only get ignored if there's
no work to be done, this seems harmless.
Diffstat (limited to 'Userland/Libraries/LibCore/EventLoop.h')
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index a8519507b4..7b49eb8e8f 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2018-2023, Andreas Kling <kling@serenityos.org> * Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org> * Copyright (c) 2022, the SerenityOS developers. * @@ -55,11 +55,6 @@ public: Yes, }; - enum class ShouldWake { - No, - Yes - }; - enum class WaitMode { WaitForEvents, PollForEvents, @@ -82,9 +77,8 @@ public: // Pump the event loop until some condition is met. void spin_until(Function<bool()>); - // Post an event to this event loop and possibly wake the loop. - void post_event(Object& receiver, NonnullOwnPtr<Event>&&, ShouldWake = ShouldWake::No); - void wake_once(Object& receiver, int custom_event_type); + // Post an event to this event loop. + void post_event(Object& receiver, NonnullOwnPtr<Event>&&); void add_job(NonnullRefPtr<Promise<NonnullRefPtr<Object>>> job_promise); |