diff options
author | Justin DeMartino <jjdemartino@google.com> | 2020-10-14 19:39:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-10-14 19:39:53 +0000 |
commit | 0d11af03e43f110b0bb160f7e20436d0043e3038 (patch) | |
tree | 48f8bcca856276ec73a86dd3fb26143d3ca64578 /libutils/Threads.cpp | |
parent | 075666ebd0dee8d0c4a2efa54f7c324a3f67ee2a (diff) | |
parent | a6c01e4e98d2b343dcecfc99611e2e6250c730db (diff) |
Merge changes from topic "SP1A.200921.001" into s-keystone-qcom-dev
* changes:
fs_mgr: adb-remount-test.sh: filter out more administrivia mounts.
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); |