diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-12-13 18:45:29 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-12-14 11:03:03 +0100 |
commit | 1d8235f5b899a2cd8414522b2d72b96fab91577b (patch) | |
tree | 2ab56dce064de872525db7f24ba150a9065c4757 /platform/default/src/mbgl/util/shared_thread_pool.cpp | |
parent | c2a4a8822ce9577c972975da61034a30fb0fe3e9 (diff) | |
download | qtlocation-mapboxgl-1d8235f5b899a2cd8414522b2d72b96fab91577b.tar.gz |
[build] rework platform/default directory and add -files.txt for vendored libs
Diffstat (limited to 'platform/default/src/mbgl/util/shared_thread_pool.cpp')
-rw-r--r-- | platform/default/src/mbgl/util/shared_thread_pool.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/default/src/mbgl/util/shared_thread_pool.cpp b/platform/default/src/mbgl/util/shared_thread_pool.cpp new file mode 100644 index 0000000000..d7facbab94 --- /dev/null +++ b/platform/default/src/mbgl/util/shared_thread_pool.cpp @@ -0,0 +1,14 @@ +#include <mbgl/util/shared_thread_pool.hpp> + +namespace mbgl { + +std::shared_ptr<ThreadPool> sharedThreadPool() { + static std::weak_ptr<ThreadPool> weak; + auto pool = weak.lock(); + if (!pool) { + weak = pool = std::make_shared<ThreadPool>(4); + } + return pool; +} + +} // namespace mbgl |