Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fdb98ba authored by Steven Moreland's avatar Steven Moreland
Browse files

Reland "Disallow shrinking threadpool size once started."

This reverts commit 0a09c76c.

Bug: 147699567
Test: atest LibStatsPullTests now passes
Reason for revert: b/150904425 is fixed.

Change-Id: I00451b5f146dbb9086d395a8bf50e5929a6b7839
parent 0a09c76c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -324,6 +324,8 @@ void ProcessState::spawnPooledThread(bool isMain)
}
}


status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) {
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;
    status_t result = NO_ERROR;
    if (ioctl(mDriverFD, BINDER_SET_MAX_THREADS, &maxThreads) != -1) {
    if (ioctl(mDriverFD, BINDER_SET_MAX_THREADS, &maxThreads) != -1) {
        mMaxThreads = maxThreads;
        mMaxThreads = maxThreads;