summaryrefslogtreecommitdiff
path: root/src/mbgl/actor
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/actor')
-rw-r--r--src/mbgl/actor/mailbox.cpp6
-rw-r--r--src/mbgl/actor/mailbox.hpp2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mbgl/actor/mailbox.cpp b/src/mbgl/actor/mailbox.cpp
index ae3c0967af..5f60629833 100644
--- a/src/mbgl/actor/mailbox.cpp
+++ b/src/mbgl/actor/mailbox.cpp
@@ -52,4 +52,10 @@ void Mailbox::receive() {
}
}
+void Mailbox::maybeReceive(std::weak_ptr<Mailbox> mailbox) {
+ if (auto locked = mailbox.lock()) {
+ locked->receive();
+ }
+}
+
} // namespace mbgl
diff --git a/src/mbgl/actor/mailbox.hpp b/src/mbgl/actor/mailbox.hpp
index 5d5e8cb924..cff0de243a 100644
--- a/src/mbgl/actor/mailbox.hpp
+++ b/src/mbgl/actor/mailbox.hpp
@@ -18,6 +18,8 @@ public:
void close();
void receive();
+ static void maybeReceive(std::weak_ptr<Mailbox>);
+
private:
Scheduler& scheduler;