summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2020-01-31 17:01:12 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2020-02-06 23:54:19 +0200
commit4be2fa4f9af29cfad869412d2d794964554d4eba (patch)
tree94d2b3f93457242930f43a2171714c5ce06634df /platform/android
parent5789faf11ae2a740927bce599a209883a78b113e (diff)
downloadqtlocation-mapboxgl-4be2fa4f9af29cfad869412d2d794964554d4eba.tar.gz
[core] Add platform::setCurrentThreadPriority(double)
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/src/thread.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/src/thread.cpp b/platform/android/src/thread.cpp
index cd0a72306e..f480fc5d43 100644
--- a/platform/android/src/thread.cpp
+++ b/platform/android/src/thread.cpp
@@ -40,6 +40,14 @@ void makeThreadLowPriority() {
setpriority(PRIO_PROCESS, 0, 19);
}
+void setCurrentThreadPriority(double priority) {
+ if (priority < -20 || priority > 19) {
+ Log::Warning(Event::General, "Couldn't set thread priority");
+ return;
+ }
+ setpriority(PRIO_PROCESS, 0, int(priority));
+}
+
void attachThread() {
using namespace android;
assert(env == nullptr);