diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-09 16:23:12 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-10-09 23:46:11 +0300 |
commit | f62e5b00c98b50e9d9a1e76f4ae5e70129e83ff4 (patch) | |
tree | d5c639664127f009ff3d720be518f6bd157d7e4b /src | |
parent | da490c2b90125bf82fc84b1782a795e48ab5a548 (diff) | |
download | qtlocation-mapboxgl-f62e5b00c98b50e9d9a1e76f4ae5e70129e83ff4.tar.gz |
[core] Introduce Scheduler::makeWeakPtr()
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/util/thread_pool.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mbgl/util/thread_pool.hpp b/src/mbgl/util/thread_pool.hpp index f302e50914..7642f9b4ca 100644 --- a/src/mbgl/util/thread_pool.hpp +++ b/src/mbgl/util/thread_pool.hpp @@ -52,8 +52,11 @@ public: } } + mapbox::base::WeakPtr<Scheduler> makeWeakPtr() override { return weakFactory.makeWeakPtr(); } + private: std::array<std::thread, N> threads; + mapbox::base::WeakPtrFactory<Scheduler> weakFactory{this}; static_assert(N > 0, "Thread count must be more than zero."); }; |