diff options
author | Andreas Kling <kling@serenityos.org> | 2023-04-23 21:19:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-25 14:48:40 +0200 |
commit | 029f5b0dad4885920078775644ca292b8aeac4b8 (patch) | |
tree | 428f09a0d331a7ba2cf75bc27ef5401bef24bb90 /Userland/Libraries | |
parent | 411d36719e8ee562bede1a6520891df4e43992f2 (diff) | |
download | serenity-029f5b0dad4885920078775644ca292b8aeac4b8.zip |
LibCore: Move deferred_invoke() implementation out of line
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.cpp | 11 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/EventLoop.h | 12 |
2 files changed, 13 insertions, 10 deletions
diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index c8f48c6ebf..98a4e6ab02 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -847,4 +847,15 @@ void EventLoop::wake() } } +void EventLoop::deferred_invoke(Function<void()> invokee) +{ + auto context = DeferredInvocationContext::construct(); + post_event(context, make<Core::DeferredInvocationEvent>(context, move(invokee))); +} + +void deferred_invoke(Function<void()> invokee) +{ + EventLoop::current().deferred_invoke(move(invokee)); +} + } diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index 8feaf4e84e..75be2f3c81 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -17,7 +17,6 @@ #include <AK/Time.h> #include <AK/Vector.h> #include <AK/WeakPtr.h> -#include <LibCore/DeferredInvocationContext.h> #include <LibCore/Event.h> #include <LibCore/Forward.h> #include <LibThreading/MutexProtected.h> @@ -82,11 +81,7 @@ public: void add_job(NonnullRefPtr<Promise<NonnullRefPtr<Object>>> job_promise); - void deferred_invoke(Function<void()> invokee) - { - auto context = DeferredInvocationContext::construct(); - post_event(context, make<Core::DeferredInvocationEvent>(context, move(invokee))); - } + void deferred_invoke(Function<void()>); void wake(); @@ -134,9 +129,6 @@ private: NonnullOwnPtr<Private> m_private; }; -inline void deferred_invoke(Function<void()> invokee) -{ - EventLoop::current().deferred_invoke(move(invokee)); -} +void deferred_invoke(Function<void()>); } |