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

Commit 4364aa2f authored by Devin Moore's avatar Devin Moore Committed by Automerger Merge Worker
Browse files

Merge "binder: Add an API to check if the threadpool has been started" am:...

Merge "binder: Add an API to check if the threadpool has been started" am: 13ba5335 am: 1661658b am: 8cc04a84

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2334882



Change-Id: Icf104bbf2707237254f9ed79a0c51eb1b541837f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 86f01ba2 8cc04a84
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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[] = {
+5 −0
Original line number Diff line number Diff line
@@ -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,
+7 −0
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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