Loading libs/binder/ProcessState.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ size_t ProcessState::getThreadPoolMaxTotalThreadCount() const { return mCurrentThreads; } bool ProcessState::isThreadPoolStarted() const { return mThreadPoolStarted; } #define DRIVER_FEATURES_PATH "/dev/binderfs/features/" bool ProcessState::isDriverFeatureEnabled(const DriverFeature feature) { static const char* const names[] = { Loading libs/binder/include/binder/ProcessState.h +5 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ public: */ size_t getThreadPoolMaxTotalThreadCount() const; /** * Check to see if the thread pool has started. */ bool isThreadPoolStarted() const; enum class DriverFeature { ONEWAY_SPAM_DETECTION, EXTENDED_ERROR, Loading libs/binder/ndk/include_platform/android/binder_process.h +7 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,13 @@ void ABinderProcess_startThreadPool(); * function should be responsible for configuring the threadpool for the entire application. */ bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); /** * Check if the threadpool has already been started. * This tells whether someone in the process has called ABinderProcess_startThreadPool. Usually, * you should use this in a library to abort if the threadpool is not started. * Programs should configure binder threadpools once at the beginning. */ bool ABinderProcess_isThreadPoolStarted(); /** * This adds the current thread to the threadpool. This may cause the threadpool to exceed the * maximum size. Loading libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ LIBBINDER_NDK33 { # introduced=33 LIBBINDER_NDK34 { # introduced=UpsideDownCake global: ABinderProcess_isThreadPoolStarted; # systemapi llndk AServiceManager_getUpdatableApexName; # systemapi AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk Loading libs/binder/ndk/process.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ void ABinderProcess_startThreadPool() { bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads) { return ProcessState::self()->setThreadPoolMaxThreadCount(numThreads) == 0; } bool ABinderProcess_isThreadPoolStarted() { return ProcessState::self()->isThreadPoolStarted(); } void ABinderProcess_joinThreadPool() { IPCThreadState::self()->joinThreadPool(); } Loading Loading
libs/binder/ProcessState.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ size_t ProcessState::getThreadPoolMaxTotalThreadCount() const { return mCurrentThreads; } bool ProcessState::isThreadPoolStarted() const { return mThreadPoolStarted; } #define DRIVER_FEATURES_PATH "/dev/binderfs/features/" bool ProcessState::isDriverFeatureEnabled(const DriverFeature feature) { static const char* const names[] = { Loading
libs/binder/include/binder/ProcessState.h +5 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,11 @@ public: */ size_t getThreadPoolMaxTotalThreadCount() const; /** * Check to see if the thread pool has started. */ bool isThreadPoolStarted() const; enum class DriverFeature { ONEWAY_SPAM_DETECTION, EXTENDED_ERROR, Loading
libs/binder/ndk/include_platform/android/binder_process.h +7 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,13 @@ void ABinderProcess_startThreadPool(); * function should be responsible for configuring the threadpool for the entire application. */ bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads); /** * Check if the threadpool has already been started. * This tells whether someone in the process has called ABinderProcess_startThreadPool. Usually, * you should use this in a library to abort if the threadpool is not started. * Programs should configure binder threadpools once at the beginning. */ bool ABinderProcess_isThreadPoolStarted(); /** * This adds the current thread to the threadpool. This may cause the threadpool to exceed the * maximum size. Loading
libs/binder/ndk/libbinder_ndk.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ LIBBINDER_NDK33 { # introduced=33 LIBBINDER_NDK34 { # introduced=UpsideDownCake global: ABinderProcess_isThreadPoolStarted; # systemapi llndk AServiceManager_getUpdatableApexName; # systemapi AServiceManager_registerForServiceNotifications; # systemapi llndk AServiceManager_NotificationRegistration_delete; # systemapi llndk Loading
libs/binder/ndk/process.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ void ABinderProcess_startThreadPool() { bool ABinderProcess_setThreadPoolMaxThreadCount(uint32_t numThreads) { return ProcessState::self()->setThreadPoolMaxThreadCount(numThreads) == 0; } bool ABinderProcess_isThreadPoolStarted() { return ProcessState::self()->isThreadPoolStarted(); } void ABinderProcess_joinThreadPool() { IPCThreadState::self()->joinThreadPool(); } Loading