summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2020-03-04 17:02:10 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-03-04 17:02:10 +0000
commit70f592a6cf9a63cdf1b01274a4430b2de1505af9 (patch)
treed67b5c37962c868f489a2861bc5d0bd3e34636c9 /libs/binder/ProcessState.cpp
parentdd5506c2363d3442303122b6f3df7c15f83f4b77 (diff)
parente52a3b607d8b6be8c550a0e0de0e48f630514e5d (diff)
Merge "Disallow shrinking threadpool size once started."
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;