[core] make RunLoop::schedule public

This commit is contained in:
Ivo van Dongen
2017-07-25 17:39:45 +03:00
committed by Ivo van Dongen
parent edaa002c3c
commit 1ff8b3a799

View File

@@ -62,6 +62,12 @@ public:
push(task);
return std::make_unique<WorkRequest>(task);
}
void schedule(std::weak_ptr<Mailbox> mailbox) override {
invoke([mailbox] () {
Mailbox::maybeReceive(mailbox);
});
}
class Impl;
@@ -72,12 +78,6 @@ private:
void push(std::shared_ptr<WorkTask>);
void schedule(std::weak_ptr<Mailbox> mailbox) override {
invoke([mailbox] () {
Mailbox::maybeReceive(mailbox);
});
}
void withMutex(std::function<void()>&& fn) {
std::lock_guard<std::mutex> lock(mutex);
fn();