[general] moving ios and android project under ./platform folder
This commit is contained in:
19
src/mbgl/util/thread.cpp
Normal file
19
src/mbgl/util/thread.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <functional>
|
||||
#include <mbgl/platform/settings.hpp>
|
||||
#include <mbgl/util/platform.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
std::function<void()> makeThreadPrioritySetter(std::string threadType_) {
|
||||
return [threadType = std::move(threadType_)] {
|
||||
auto& settings = platform::Settings::getInstance();
|
||||
auto value = settings.get(threadType);
|
||||
if (auto* priority = value.getDouble()) {
|
||||
platform::setCurrentThreadPriority(*priority);
|
||||
} else {
|
||||
platform::makeThreadLowPriority();
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace util
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user