Merge "add set thread count"

This commit is contained in:
Mathias Agopian 2012-04-18 18:36:16 -07:00 committed by Android (Google) Code Review
commit 9798ff28b8
2 changed files with 11 additions and 0 deletions

View File

@ -70,6 +70,8 @@ public:
void spawnPooledThread(bool isMain);
status_t setThreadPoolMaxThreadCount(size_t maxThreads);
private:
friend class IPCThreadState;

View File

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