summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/EventLoop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibCore/EventLoop.cpp')
-rw-r--r--Userland/Libraries/LibCore/EventLoop.cpp11
1 files changed, 11 insertions, 0 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));
+}
+
}