summaryrefslogtreecommitdiff
path: root/libutils/Threads.cpp
AgeCommit message (Collapse)Author
2021-12-10libutils: do not follow process's groupWei Wang
1) App doesn't have cgroup access and there is no purpose of reading cgroup for app. For system_server it should be known in foreground group. So there is no benefit of reading group. 2) Reading cgroup in apps can also cause contention for other cgroup operations. 3) vendor can change cgroup setting and get_sched_policy may return incorrect information for get_sched_policy_profile_name. Test: Boot Bug: 210011562 Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I8e8c8b346984781c56ec93c0616121f7d5c99fe5
2021-10-07libutils: use system_background for low prio tasks in frameworkWei Wang
Bug: 201428466 Test: Build and boot check system_server's sched group Signed-off-by: Wei Wang <wvw@google.com> Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c Merged-In: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
2020-09-27Revert "Add choice for changing sched policy when setting thread priority"Rick Yiu
This reverts commit 57affbf91d016eda1395106c4d5f0350471dca85. Reason for revert: new API is no longer used Change-Id: I97128c1d367e161aa50deaefa8b73a0f25e29af4
2020-09-27Revert "Fix API for C compatibility"Rick Yiu
This reverts commit b473061c5a1b6e609188310e8d63f12380b4c74a. Reason for revert: new API is no longer used Change-Id: I2c4f9f37736faeb5d0403c2ba531c792d2531505
2020-08-24Fix API for C compatibilityGreg Kaiser
In https://android-review.googlesource.com/c/platform/system/core/+/1224544 when we introduced a default argument to androidSetThreadPriority(), we broke C compatibility with this API, and with the header file in general. We fix this up by instead introducing a new method that takes three arguments. This gets this header file compiling for C again, and keeps this particular API C compatible. Any C++ callers of the three argument version of androidSetThreadPriority() will need to switch to using androidSetThreadPriorityAndPolicy(). Although since this was a recent change, we believe there is only one such user, which we are fixing at the same time. Test: TreeHugger Bug: 165009705 Merged-In: Iab0b7e6c91a8e32a17ba1b186fd0c2fe96b601e4 Change-Id: Iab0b7e6c91a8e32a17ba1b186fd0c2fe96b601e4
2020-05-15Add choice for changing sched policy when setting thread priorityRick Yiu
If the policy has been changed already, we do not need to change it again. Bug: 139521784 Test: functionality verified Change-Id: I251db1d3f874896ba9be68df87209e7e514b80f9
2020-02-07Refine set_sched_policy behaviorRick Yiu
If a thread priority is greater than or equal to ANDROID_PRIORITY_BACKGROUND, and the new priority is less than ANDROID_PRIORITY_BACKGROUND, set the sched policy to its parent process. Bug: 139521784 Test: functionality verified Change-Id: Ie6fe33e08e4fda0a119b9869e8dd1733c164d79e
2019-01-22Add dependencies on libprocessgroup for sched_policy usersSuren Baghdasaryan
After moving sched_policy functions into libprocessgroup its users require additional dependency and inclusion of sched_policy_ctrl.h header. Exempt-From-Owner-Approval: janitorial Bug: 111307099 Test: builds, boots Merged-In: Icc052080e1bce46ce06f7264446950cab0490a95 Change-Id: Icc052080e1bce46ce06f7264446950cab0490a95 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-08Move system/core/ off NO_ERROR.Elliott Hughes
It causes trouble for Windows, and OK already exists. Bug: N/A Test: builds Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
2018-07-16[libutils] Modernize codebase by replacing NULL with nullptrYi Kong
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5e89ec8c42151875439d2656475a8739ab9cb7dc
2017-11-29Fix / suppress new unused warnings for mingw+clangDan Willemsen
Bug: 69933068 Test: mmma system/core Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
2017-03-03clean-up libutils includesMathias Agopian
moved Foo.h as first include of Foo.cpp, and removed redundant includes. Made NativeHandle non virtual. Test: run & compile Bug: n/a Change-Id: I37fa746cd42c9ba23aba181f84cb6c619386406a
2016-03-12system/core: Make Thread::run threadName argument requiredBrian Carlstrom
Bug: 27557176 Change-Id: Iae83a1e5489c86c2858fc8481f246b8480f0eec4
2015-07-30Use __ANDROID__ instead of HAVE_ANDROID_OS.Elliott Hughes
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-06-30Consistently use strerror in libutils.Elliott Hughes
It's easier for people to debug, and side-steps the problem that errno values differ between architectures. Bug: http://b/17458391 Change-Id: I1db9b2cbb653839d3936b91e37e5cff02671318a
2015-01-27Kill HAVE_PTHREADS.Yabin Cui
Bug: 19083585 Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2014-12-15Fix references to HAVE_PRCTL.Elliott Hughes
Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
2014-09-12Move libutils over to pthread_gettid_np.Elliott Hughes
Bug: 17476168 Change-Id: I934d93a023eb00e036ed3cee8c52efaeb17b8915
2014-08-18Remove androidGetTid.Elliott Hughes
Bug: 17048545 Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
2014-07-31Exclude bionic private headers from include pathDmitriy Ivanov
Change-Id: I8b1269a739a690af91c63fa0f7f8f01d2d43bb97
2014-06-02libutils: turn on -WerrorMark Salyzyn
- Deal with some -Wunused issues - Override PRI macros (windows) - Revert use of PRI macros on off64_t (linux) - Deal with a gnu++11 complaince issue Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
2013-08-02move libs/utils to libutilsAlex Ray
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d