summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-03-09 20:09:17 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-03-09 20:09:17 +0000
commit833b6bd5df1f466bdabfb4f966128a1a6c234438 (patch)
tree02a5fbaffa068fd86b999e8060b982af35a6651a /libs/binder/ProcessState.cpp
parent6630407efaf8630c584465ad18ab7952717f5827 (diff)
parent0d4dfb1c9b6344023495e8916251311415759b12 (diff)
Merge "Reland "Disallow shrinking threadpool size once started."" am: 0d4dfb1c9b
Change-Id: I93a3cdacf2ef27b41313cdd3e1ac29136c54a861
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 631e8c5cb2..0f81e0bef0 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -328,6 +328,8 @@ void ProcessState::spawnPooledThread(bool isMain)
}
status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) {
+ LOG_ALWAYS_FATAL_IF(mThreadPoolStarted && maxThreads < mMaxThreads,
+ "Binder threadpool cannot be shrunk after starting");
status_t result = NO_ERROR;
if (ioctl(mDriverFD, BINDER_SET_MAX_THREADS, &maxThreads) != -1) {
mMaxThreads = maxThreads;