summaryrefslogtreecommitdiff
path: root/src/mbgl/actor/mailbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/actor/mailbox.cpp')
-rw-r--r--src/mbgl/actor/mailbox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/actor/mailbox.cpp b/src/mbgl/actor/mailbox.cpp
index 20d9b25cad..b95a6dd7f6 100644
--- a/src/mbgl/actor/mailbox.cpp
+++ b/src/mbgl/actor/mailbox.cpp
@@ -25,7 +25,7 @@ void Mailbox::close() {
closed = true;
}
-void Mailbox::start(Scheduler* scheduler_) {
+void Mailbox::activate(Scheduler& scheduler_) {
assert(!scheduler);
// As with close(), block until neither receive() nor push() are in progress, and acquire the two
@@ -33,7 +33,7 @@ void Mailbox::start(Scheduler* scheduler_) {
std::lock_guard<std::recursive_mutex> receivingLock(receivingMutex);
std::lock_guard<std::mutex> pushingLock(pushingMutex);
- scheduler = scheduler_;
+ scheduler = &scheduler_;
if (closed) {
return;
@@ -44,6 +44,8 @@ void Mailbox::start(Scheduler* scheduler_) {
}
}
+bool Mailbox::isActive() const { return bool(scheduler); }
+
void Mailbox::push(std::unique_ptr<Message> message) {
std::lock_guard<std::mutex> pushingLock(pushingMutex);