diff options
author | Steven Moreland <smoreland@google.com> | 2020-10-01 23:49:45 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2020-10-01 23:49:45 +0000 |
commit | 87db54cf6a66dacd67d9e900c3fe37c1ff8522d4 (patch) | |
tree | fdc768807104cfa8e08b6ca09ac7de2d0c49a687 | |
parent | ea75dfb0735429f0b85ee8210ecff8d729a5197d (diff) | |
download | libhwbinder-87db54cf6a66dacd67d9e900c3fe37c1ff8522d4.tar.gz |
hwbinder: remove blockUntilThreadAvailable
There are performance problems associated with it, and it is completely
unused here, so removing.
Bug: 168806193
Test: N/A
Change-Id: Iea8fef19fd7f7a6ff0fff413c9ff1b06b4349f29
-rw-r--r-- | IPCThreadState.cpp | 13 | ||||
-rw-r--r-- | ProcessState.cpp | 1 | ||||
-rw-r--r-- | include/hwbinder/IPCThreadState.h | 4 | ||||
-rw-r--r-- | include/hwbinder/ProcessState.h | 1 |
4 files changed, 0 insertions, 19 deletions
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp index 3acf2f5..fbb1705 100644 --- a/IPCThreadState.cpp +++ b/IPCThreadState.cpp @@ -421,18 +421,6 @@ void IPCThreadState::flushCommands() } } -void IPCThreadState::blockUntilThreadAvailable() -{ - pthread_mutex_lock(&mProcess->mThreadCountLock); - while (mProcess->mExecutingThreadsCount >= mProcess->mMaxThreads) { - ALOGW("Waiting for thread to be free. mExecutingThreadsCount=%lu mMaxThreads=%lu\n", - static_cast<unsigned long>(mProcess->mExecutingThreadsCount), - static_cast<unsigned long>(mProcess->mMaxThreads)); - pthread_cond_wait(&mProcess->mThreadCountDecrement, &mProcess->mThreadCountLock); - } - pthread_mutex_unlock(&mProcess->mThreadCountLock); -} - status_t IPCThreadState::getAndExecuteCommand() { status_t result; @@ -472,7 +460,6 @@ status_t IPCThreadState::getAndExecuteCommand() } mProcess->mStarvationStartTimeMs = 0; } - pthread_cond_broadcast(&mProcess->mThreadCountDecrement); pthread_mutex_unlock(&mProcess->mThreadCountLock); } diff --git a/ProcessState.cpp b/ProcessState.cpp index bf54485..91aaed4 100644 --- a/ProcessState.cpp +++ b/ProcessState.cpp @@ -443,7 +443,6 @@ ProcessState::ProcessState(size_t mmapSize) : mDriverFD(open_driver()) , mVMStart(MAP_FAILED) , mThreadCountLock(PTHREAD_MUTEX_INITIALIZER) - , mThreadCountDecrement(PTHREAD_COND_INITIALIZER) , mExecutingThreadsCount(0) , mMaxThreads(DEFAULT_MAX_BINDER_THREADS) , mStarvationStartTimeMs(0) diff --git a/include/hwbinder/IPCThreadState.h b/include/hwbinder/IPCThreadState.h index ca99591..85c0bfb 100644 --- a/include/hwbinder/IPCThreadState.h +++ b/include/hwbinder/IPCThreadState.h @@ -87,10 +87,6 @@ public: static void shutdown(); - // Call blocks until the number of executing binder threads is less than - // the maximum number of binder threads threads allowed for this process. - void blockUntilThreadAvailable(); - // Service manager registration void setTheContextObject(sp<BHwBinder> obj); diff --git a/include/hwbinder/ProcessState.h b/include/hwbinder/ProcessState.h index b13559a..abd77a3 100644 --- a/include/hwbinder/ProcessState.h +++ b/include/hwbinder/ProcessState.h @@ -114,7 +114,6 @@ private: // Protects thread count variable below. pthread_mutex_t mThreadCountLock; - pthread_cond_t mThreadCountDecrement; // Number of binder threads current executing a command. size_t mExecutingThreadsCount; // Maximum number for binder threads allowed for this process. |