diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-04 12:30:41 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-04 13:54:15 +0300 |
commit | f024a3ed79e438b975301e5781b12739e150caf1 (patch) | |
tree | 47443222a5982031b4c9ecd531bea14edc61a8c8 /platform/qt/src/qmapboxgl_scheduler.hpp | |
parent | 198e3453394ccb2b1f7db72d1858cfd18e302a1e (diff) | |
download | qtlocation-mapboxgl-f024a3ed79e438b975301e5781b12739e150caf1.tar.gz |
[core] Decouple Scheduler interface from actor modelupstream/mikhail_decouple_scheduler_and_actor
So that it is possible to schedule normal `std::function` and use `mapbox::base::WeakPtr`.
Diffstat (limited to 'platform/qt/src/qmapboxgl_scheduler.hpp')
-rw-r--r-- | platform/qt/src/qmapboxgl_scheduler.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/platform/qt/src/qmapboxgl_scheduler.hpp b/platform/qt/src/qmapboxgl_scheduler.hpp index 68636d0d11..b34dd3d5b8 100644 --- a/platform/qt/src/qmapboxgl_scheduler.hpp +++ b/platform/qt/src/qmapboxgl_scheduler.hpp @@ -1,6 +1,5 @@ #pragma once -#include <mbgl/actor/mailbox.hpp> #include <mbgl/actor/scheduler.hpp> #include <mbgl/util/util.hpp> @@ -19,7 +18,7 @@ public: virtual ~QMapboxGLScheduler(); // mbgl::Scheduler implementation. - void schedule(std::weak_ptr<mbgl::Mailbox> scheduled) final; + void schedule(std::function<void()> scheduled) final; void processEvents(); @@ -30,5 +29,5 @@ private: MBGL_STORE_THREAD(tid); std::mutex m_taskQueueMutex; - std::queue<std::weak_ptr<mbgl::Mailbox>> m_taskQueue; + std::queue<std::function<void()>> m_taskQueue; }; |