summaryrefslogtreecommitdiff
path: root/platform/android/src/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/thread.cpp')
-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);