[general] moving ios and android project under ./platform folder

This commit is contained in:
Petr Pokorny
2020-12-20 12:38:56 +01:00
parent 8e759a51e4
commit 41f0be34e7
9877 changed files with 141 additions and 2889 deletions

19
src/mbgl/util/thread.cpp Normal file
View 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