summaryrefslogtreecommitdiff
path: root/libutils/Threads.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge "libutils: Remove a little dead code" am: 4a39ba316f am: 0a8e5126ef ↵Treehugger Robot2022-02-091-6/+1
|\ | | | | | | | | | | | | | | am: 9637277417 am: 74402be9d1 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1977026 Change-Id: I5fba0be1400bf89bd35692d68f2a518d486a20cb
| * libutils: Remove a little dead codeGreg Kaiser2022-02-081-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | With our recent change 0455a2c39c781a8153c1090a4638193b4181379d, there's some logic that can be simplified to make this slightly easier to read. This CL does not change the behavior of this code. Bug: 208895940 Test: TreeHugger Change-Id: I4de2dbaf4406cbb7785df8839bb3ae453186ea69
* | Merge "libutils: don't call SetTaskProfiles around priority" am: 82b74d6f15 ↵Treehugger Robot2022-02-081-14/+0
|\| | | | | | | | | | | | | | | am: 5d078b5903 am: 15af4f4bf8 am: 14f3fb79e2 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1975808 Change-Id: Id430b68f2e21c9aa28f1e3cdc127ef61d53fae2f
| * libutils: don't call SetTaskProfiles around priorityTim Murray2022-02-081-14/+0
| | | | | | | | | | | | | | | | | | | | Threads should always be in the same state as their parents. This also implies that the additional SetTaskProfiles is unnecessary when creating a new thread. Test: boots, TH Bug: 208895940 Change-Id: Id971c6e87d342a695bea106cdd258bc0ef6f7ecb
| * libutils: do not follow process's groupWei Wang2021-12-131-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Merged-In: I8e8c8b346984781c56ec93c0616121f7d5c99fe5 Change-Id: I8e8c8b346984781c56ec93c0616121f7d5c99fe5 (cherry picked from commit defb7773121545130fff80928ebcd7d6015be1d1)
* | Merge "libutils: do not follow process's group" into sc-v2-dev am: ↵Wei Wang2021-12-131-4/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | a2c0b86ad0 am: 0c54932e9e Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/16434460 Change-Id: I77333110d1a9ff52d7e3f812a1c57caec109ab86
| * | libutils: do not follow process's groupWei Wang2021-12-101-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | libutils: use system_background for low prio tasks in frameworkWei Wang2021-10-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge changes from topic "sysbg_aosp" am: 1132977223 am: d7c942ad46 am: ↵Wei Wang2021-10-071-2/+4
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 808464a9d0 am: 04557e2fd7 am: 4497e13f02 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1847154 Change-Id: I3f936b58d68d0931ee403eca9174a601d192b0a0
| * | libutils: use system_background for low prio tasks in frameworkWei Wang2021-10-061-2/+4
| |/ | | | | | | | | | | | | Bug: 201428466 Test: Build and boot check system_server's sched group Signed-off-by: Wei Wang <wvw@google.com> Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
* | Reland^2 "libutils: disable implicit ref base construction"Steven Moreland2021-04-271-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 2cb75937925e19c5cc7dccd84906b14d5297cf0a. Reason for revert: reland after fixing b/186468053 Bug: 184190315 Change-Id: I2a46b7a8148db444f9bd4b24746f64217cbba947
* | Revert "Reland "libutils: disable implicit ref base construction""Steven Moreland2021-04-271-1/+1
| | | | | | | | | | | | | | | | This reverts commit 02c47655e7d3a5a2dfaf78a5dd225f5727ff8fa4. Reason for revert: broke another test b/186468053 Change-Id: I0ec82455ad203071e523092ae3cb5f0f1df6aac7
* | Reland "libutils: disable implicit ref base construction"Steven Moreland2021-04-261-1/+1
| | | | | | | | | | | | | | | | | | This reverts commit 8e11f9e3f39617826201055c0af0ab740e9c7984. Reason for revert: reland after fixing b/186028624 Bug: 184190315 Change-Id: Ia7339a46c3af7dd1a95bc82327cae5304f9f2e16
* | Revert "libutils: disable implicit ref base construction"Steven Moreland2021-04-211-1/+1
| | | | | | | | | | | | | | | | This reverts commit 9a1bf53c4b0a45ac0072d26807b145ddcf044c28. Reason for revert: b/186028624 Change-Id: Icb8b1623df2794222ce3fe34ed5f43506ccf2f68
* | libutils: disable implicit ref base constructionSteven Moreland2021-04-191-1/+1
|/ | | | | | | | Ignore-AOSP-First: b/184196278 Bug: 184190315 Test: libutils_test Change-Id: If47f79a8b96ee75706817081950f9ca5c0d12731
* Revert "Add choice for changing sched policy when setting thread priority"Rick Yiu2020-09-271-13/+12
| | | | | | | | This reverts commit 57affbf91d016eda1395106c4d5f0350471dca85. Reason for revert: new API is no longer used Change-Id: I97128c1d367e161aa50deaefa8b73a0f25e29af4
* Revert "Fix API for C compatibility"Rick Yiu2020-09-271-11/+1
| | | | | | | | This reverts commit b473061c5a1b6e609188310e8d63f12380b4c74a. Reason for revert: new API is no longer used Change-Id: I2c4f9f37736faeb5d0403c2ba531c792d2531505
* Fix API for C compatibilityGreg Kaiser2020-08-241-1/+11
| | | | | | | | | | | | | | | | | | | | | | 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
* Add choice for changing sched policy when setting thread priorityRick Yiu2020-05-151-12/+13
| | | | | | | | | If the policy has been changed already, we do not need to change it again. Bug: 139521784 Test: functionality verified Change-Id: I251db1d3f874896ba9be68df87209e7e514b80f9
* Refine set_sched_policy behaviorRick Yiu2020-02-071-7/+21
| | | | | | | | | | 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
* Add dependencies on libprocessgroup for sched_policy usersSuren Baghdasaryan2019-01-221-1/+1
| | | | | | | | | | | | | | 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>
* Move system/core/ off NO_ERROR.Elliott Hughes2018-10-081-13/+15
| | | | | | | | It causes trouble for Windows, and OK already exists. Bug: N/A Test: builds Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
* [libutils] Modernize codebase by replacing NULL with nullptrYi Kong2018-07-161-2/+2
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5e89ec8c42151875439d2656475a8739ab9cb7dc
* Fix / suppress new unused warnings for mingw+clangDan Willemsen2017-11-291-2/+2
| | | | | | Bug: 69933068 Test: mmma system/core Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
* clean-up libutils includesMathias Agopian2017-03-031-9/+2
| | | | | | | | | | | | 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
* system/core: Make Thread::run threadName argument requiredBrian Carlstrom2016-03-121-0/+2
| | | | | Bug: 27557176 Change-Id: Iae83a1e5489c86c2858fc8481f246b8480f0eec4
* Use __ANDROID__ instead of HAVE_ANDROID_OS.Elliott Hughes2015-07-301-14/+7
| | | | Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
* Consistently use strerror in libutils.Elliott Hughes2015-06-301-2/+3
| | | | | | | | 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
* Kill HAVE_PTHREADS.Yabin Cui2015-01-271-43/+37
| | | | | Bug: 19083585 Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
* Fix references to HAVE_PRCTL.Elliott Hughes2014-12-151-2/+2
| | | | Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
* Move libutils over to pthread_gettid_np.Elliott Hughes2014-09-121-4/+1
| | | | | Bug: 17476168 Change-Id: I934d93a023eb00e036ed3cee8c52efaeb17b8915
* Remove androidGetTid.Elliott Hughes2014-08-181-9/+0
| | | | | Bug: 17048545 Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
* Exclude bionic private headers from include pathDmitriy Ivanov2014-07-311-1/+1
| | | | Change-Id: I8b1269a739a690af91c63fa0f7f8f01d2d43bb97
* libutils: turn on -WerrorMark Salyzyn2014-06-021-12/+18
| | | | | | | | | - 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
* move libs/utils to libutilsAlex Ray2013-08-021-0/+878
Change-Id: I6cf4268599460791414882f91eeb88a992fbd29d