diff options
Diffstat (limited to 'src/mbgl/util/thread_pool.cpp')
-rw-r--r-- | src/mbgl/util/thread_pool.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mbgl/util/thread_pool.cpp b/src/mbgl/util/thread_pool.cpp index 040e996dd4..e1c18a45b5 100644 --- a/src/mbgl/util/thread_pool.cpp +++ b/src/mbgl/util/thread_pool.cpp @@ -1,8 +1,9 @@ #include <mbgl/util/thread_pool.hpp> +#include <mbgl/platform/settings.hpp> +#include <mbgl/platform/thread.hpp> #include <mbgl/util/platform.hpp> #include <mbgl/util/string.hpp> -#include <mbgl/platform/thread.hpp> namespace mbgl { @@ -17,7 +18,13 @@ void ThreadedSchedulerBase::terminate() { } std::thread ThreadedSchedulerBase::makeSchedulerThread(size_t index) { - return std::thread([this, index]() { + return std::thread([this, index] { + auto& settings = platform::Settings::getInstance(); + auto value = settings.get(platform::EXPERIMENTAL_THREAD_PRIORITY_WORKER); + if (auto* priority = value.getDouble()) { + platform::setCurrentThreadPriority(*priority); + } + platform::setCurrentThreadName(std::string{"Worker "} + util::toString(index + 1)); platform::attachThread(); |