diff options
author | Justin DeMartino <jjdemartino@google.com> | 2020-09-21 13:24:08 -0700 |
---|---|---|
committer | Justin DeMartino <jjdemartino@google.com> | 2020-09-21 13:24:08 -0700 |
commit | 338e91517f011da3056cdab4fe75198281cbc997 (patch) | |
tree | daadd64a0a84b5836dda7d2ce15737d4d59abdae /libutils/Threads.cpp | |
parent | 9a1114d8a44e4d93a719095ad81c119273d43ee4 (diff) | |
parent | 79c5fee02e1430bec2f75956297f5b631e70b407 (diff) |
Merge SP1A.200921.001
Change-Id: I90b97c4e9fb10b1f45e74def404823eed5b1aaa8
Diffstat (limited to 'libutils/Threads.cpp')
-rw-r--r-- | libutils/Threads.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index 147db542d..55eadb07a 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -302,7 +302,8 @@ void androidSetCreateThreadFunc(android_create_thread_fn func) } #if defined(__ANDROID__) -int androidSetThreadPriority(pid_t tid, int pri, bool change_policy) { +namespace { +int androidSetThreadPriorityInternal(pid_t tid, int pri, bool change_policy) { int rc = 0; int lasterr = 0; int curr_pri = getpriority(PRIO_PROCESS, tid); @@ -334,6 +335,15 @@ int androidSetThreadPriority(pid_t tid, int pri, bool change_policy) { return rc; } +} // namespace + +int androidSetThreadPriority(pid_t tid, int pri) { + return androidSetThreadPriorityInternal(tid, pri, true); +} + +int androidSetThreadPriorityAndPolicy(pid_t tid, int pri, bool change_policy) { + return androidSetThreadPriorityInternal(tid, pri, change_policy); +} int androidGetThreadPriority(pid_t tid) { return getpriority(PRIO_PROCESS, tid); |