summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-04-23 21:19:37 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-25 14:48:40 +0200
commit029f5b0dad4885920078775644ca292b8aeac4b8 (patch)
tree428f09a0d331a7ba2cf75bc27ef5401bef24bb90 /Userland/Libraries
parent411d36719e8ee562bede1a6520891df4e43992f2 (diff)
downloadserenity-029f5b0dad4885920078775644ca292b8aeac4b8.zip
LibCore: Move deferred_invoke() implementation out of line
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp11
-rw-r--r--Userland/Libraries/LibCore/EventLoop.h12
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()>);
}