[ios,macos,android,qt] use shared threadpool

This commit is contained in:
Konstantin Käfer
2017-02-20 14:59:17 +01:00
parent 4e752f63b9
commit 3ef9e26593
13 changed files with 52 additions and 22 deletions

View File

@@ -0,0 +1,14 @@
#include "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