summaryrefslogtreecommitdiff
path: root/include/mbgl/util/run_loop.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-04 12:30:41 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-04 17:42:21 +0300
commitbef635765a1bbec14d7732856c38c037ea8add6a (patch)
tree47443222a5982031b4c9ecd531bea14edc61a8c8 /include/mbgl/util/run_loop.hpp
parent198e3453394ccb2b1f7db72d1858cfd18e302a1e (diff)
downloadqtlocation-mapboxgl-bef635765a1bbec14d7732856c38c037ea8add6a.tar.gz
[core] Decouple Scheduler interface from actor model
So that it is possible to schedule normal `std::function` and use `mapbox::base::WeakPtr`.
Diffstat (limited to 'include/mbgl/util/run_loop.hpp')
-rw-r--r--include/mbgl/util/run_loop.hpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/mbgl/util/run_loop.hpp b/include/mbgl/util/run_loop.hpp
index 381e3ae213..961573fd87 100644
--- a/include/mbgl/util/run_loop.hpp
+++ b/include/mbgl/util/run_loop.hpp
@@ -72,12 +72,8 @@ public:
push(Priority::Default, task);
return std::make_unique<WorkRequest>(task);
}
-
- void schedule(std::weak_ptr<Mailbox> mailbox) override {
- invoke([mailbox] () {
- Mailbox::maybeReceive(mailbox);
- });
- }
+
+ void schedule(std::function<void()> fn) override { invoke(std::move(fn)); }
class Impl;