diff options
Diffstat (limited to 'Userland')
-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()>); } |