LibCore: Move deferred_invoke() implementation out of line

This commit is contained in:
Andreas Kling 2023-04-23 21:19:37 +02:00
parent 411d36719e
commit 029f5b0dad
Notes: sideshowbarker 2024-07-17 02:42:21 +09:00
2 changed files with 13 additions and 10 deletions

View File

@ -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));
}
}

View File

@ -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()>);
}