From 4be2fa4f9af29cfad869412d2d794964554d4eba Mon Sep 17 00:00:00 2001 From: Alexander Shalamov Date: Fri, 31 Jan 2020 17:01:12 +0200 Subject: [core] Add platform::setCurrentThreadPriority(double) --- platform/android/src/thread.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'platform/android') 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); -- cgit v1.2.1