Merge "Disallow shrinking threadpool size once started." am: 70f592a6cf

Change-Id: I50c7b0aba4d22a08de0b78775c2c352e92bbbb95
This commit is contained in:
Automerger Merge Worker 2020-03-04 17:08:46 +00:00
commit 9ee812fdc9

View file

@ -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;