Skip to content

Commit

Permalink
libcore|EventLoop: Event loop callback utility
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 3223377 commit d1f0d15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/libs/core/include/de/core/eventloop.h
Expand Up @@ -80,6 +80,7 @@ class DE_PUBLIC EventLoop

public:
static void post(Event *event);
static void callback(const std::function<void()> &);

private:
DE_PRIVATE(d)
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libs/core/src/core/eventloop.cpp
Expand Up @@ -190,6 +190,11 @@ void EventLoop::post(Event *event) // static
}
}

void EventLoop::callback(const std::function<void()> &func) // static
{
post(new CoreEvent(func));
}

EventLoop *EventLoop::get()
{
using namespace internal;
Expand Down

0 comments on commit d1f0d15

Please sign in to comment.