From 1fdb98baf21fe39541f613e30f6385a76e19735c Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 6 Mar 2020 21:42:12 +0000 Subject: Reland "Disallow shrinking threadpool size once started." This reverts commit 0a09c76c713ded94ab38e6917402251977923baf. Bug: 147699567 Test: atest LibStatsPullTests now passes Reason for revert: b/150904425 is fixed. Change-Id: I00451b5f146dbb9086d395a8bf50e5929a6b7839 --- libs/binder/ProcessState.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp index c0f5e31d72..6627618ddf 100644 --- a/libs/binder/ProcessState.cpp +++ b/libs/binder/ProcessState.cpp @@ -324,6 +324,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; -- cgit v1.2.3-59-g8ed1b