Loading libs/binder/BpBinder.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,14 @@ status_t BpBinder::linkToDeath( LOG_ALWAYS_FATAL_IF(recipient == nullptr, "linkToDeath(): recipient must be non-NULL"); if (ProcessState::self()->getThreadPoolMaxTotalThreadCount() == 0) { ALOGW("Linking to death on %s but there are no threads (yet?) listening to incoming " "transactions. See ProcessState::startThreadPool and " "ProcessState::setThreadPoolMaxThreadCount. Generally you should setup the binder " "threadpool before other initialization steps.", String8(getInterfaceDescriptor()).c_str()); } { AutoMutex _l(mLock); Loading libs/binder/ProcessState.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <binder/ProcessState.h> #include <android-base/result.h> #include <android-base/scopeguard.h> #include <android-base/strings.h> #include <binder/BpBinder.h> #include <binder/IPCThreadState.h> Loading Loading @@ -420,6 +421,9 @@ status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) { } size_t ProcessState::getThreadPoolMaxTotalThreadCount() const { pthread_mutex_lock(&mThreadCountLock); base::ScopeGuard detachGuard = [&]() { pthread_mutex_unlock(&mThreadCountLock); }; // may actually be one more than this, if join is called if (mThreadPoolStarted) { return mCurrentThreads < mKernelStartedThreads Loading libs/binder/include/binder/ProcessState.h +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ private: void* mVMStart; // Protects thread count and wait variables below. pthread_mutex_t mThreadCountLock; mutable pthread_mutex_t mThreadCountLock; // Broadcast whenever mWaitingForThreads > 0 pthread_cond_t mThreadCountDecrement; // Number of binder threads current executing a command. Loading Loading
libs/binder/BpBinder.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,14 @@ status_t BpBinder::linkToDeath( LOG_ALWAYS_FATAL_IF(recipient == nullptr, "linkToDeath(): recipient must be non-NULL"); if (ProcessState::self()->getThreadPoolMaxTotalThreadCount() == 0) { ALOGW("Linking to death on %s but there are no threads (yet?) listening to incoming " "transactions. See ProcessState::startThreadPool and " "ProcessState::setThreadPoolMaxThreadCount. Generally you should setup the binder " "threadpool before other initialization steps.", String8(getInterfaceDescriptor()).c_str()); } { AutoMutex _l(mLock); Loading
libs/binder/ProcessState.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <binder/ProcessState.h> #include <android-base/result.h> #include <android-base/scopeguard.h> #include <android-base/strings.h> #include <binder/BpBinder.h> #include <binder/IPCThreadState.h> Loading Loading @@ -420,6 +421,9 @@ status_t ProcessState::setThreadPoolMaxThreadCount(size_t maxThreads) { } size_t ProcessState::getThreadPoolMaxTotalThreadCount() const { pthread_mutex_lock(&mThreadCountLock); base::ScopeGuard detachGuard = [&]() { pthread_mutex_unlock(&mThreadCountLock); }; // may actually be one more than this, if join is called if (mThreadPoolStarted) { return mCurrentThreads < mKernelStartedThreads Loading
libs/binder/include/binder/ProcessState.h +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ private: void* mVMStart; // Protects thread count and wait variables below. pthread_mutex_t mThreadCountLock; mutable pthread_mutex_t mThreadCountLock; // Broadcast whenever mWaitingForThreads > 0 pthread_cond_t mThreadCountDecrement; // Number of binder threads current executing a command. Loading