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

Commit 1b80f793 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

add set thread count

Change-Id: I70f02908d8362a465eb8a2a24356f6989847f7ba
parent aa1667f0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ public:

            void                spawnPooledThread(bool isMain);
            
            status_t            setThreadPoolMaxThreadCount(size_t maxThreads);

private:
    friend class IPCThreadState;
    
+9 −0
Original line number Diff line number Diff line
@@ -295,6 +295,15 @@ void ProcessState::spawnPooledThread(bool isMain)
    }
}

status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) {
    status_t result = NO_ERROR;
    if (ioctl(mDriverFD, BINDER_SET_MAX_THREADS, &maxThreads) == -1) {
        result = -errno;
        ALOGE("Binder ioctl to set max threads failed: %s", strerror(-result));
    }
    return result;
}

static int open_driver()
{
    int fd = open("/dev/binder", O_RDWR);