Loading libs/binder/Binder.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -593,8 +593,9 @@ int BBinder::getMinSchedulerPriority() { bool BBinder::isInheritRt() { Extras* e = mExtras.load(std::memory_order_acquire); return e && e->mInheritRt; // Return configured default value if it has not been overridden if (e == nullptr) return sGlobalInheritRt.load(std::memory_order_acquire); return e->mInheritRt; } void BBinder::setInheritRt(bool inheritRt) { Loading @@ -616,6 +617,12 @@ void BBinder::setInheritRt(bool inheritRt) { e->mInheritRt = inheritRt; } std::atomic<bool> BBinder::sGlobalInheritRt(false); void BBinder::setGlobalInheritRt(bool enabled) { sGlobalInheritRt.store(enabled, std::memory_order_release); } pid_t BBinder::getDebugPid() { #ifdef __linux__ return getpid(); Loading Loading @@ -744,7 +751,7 @@ BBinder::~BBinder() if (isRequestingSid()) { ALOGW("Binder %p destroyed when requesting SID before being parceled.", this); } if (isInheritRt()) { if (sGlobalInheritRt.load(std::memory_order_acquire) != isInheritRt()) { ALOGW("Binder %p destroyed after setInheritRt before being parceled.", this); } #ifdef __linux__ Loading libs/binder/include/binder/Binder.h +7 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,11 @@ public: // This must be called before the object is sent to another process. Not thread safe. LIBBINDER_EXPORTED void setInheritRt(bool inheritRt); // Set default, overridden by setInheritRt. You must set this default early. // Any binder objects sent out of the process before this is called will // not use the updated value. LIBBINDER_EXPORTED static void setGlobalInheritRt(bool enabled); LIBBINDER_EXPORTED pid_t getDebugPid(); // Whether this binder has been sent to another process. Loading Loading @@ -124,6 +129,8 @@ private: [[nodiscard]] status_t startRecordingTransactions(const Parcel& data); [[nodiscard]] status_t stopRecordingTransactions(); static std::atomic<bool> sGlobalInheritRt; std::atomic<Extras*> mExtras; friend ::android::internal::Stability; Loading Loading
libs/binder/Binder.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -593,8 +593,9 @@ int BBinder::getMinSchedulerPriority() { bool BBinder::isInheritRt() { Extras* e = mExtras.load(std::memory_order_acquire); return e && e->mInheritRt; // Return configured default value if it has not been overridden if (e == nullptr) return sGlobalInheritRt.load(std::memory_order_acquire); return e->mInheritRt; } void BBinder::setInheritRt(bool inheritRt) { Loading @@ -616,6 +617,12 @@ void BBinder::setInheritRt(bool inheritRt) { e->mInheritRt = inheritRt; } std::atomic<bool> BBinder::sGlobalInheritRt(false); void BBinder::setGlobalInheritRt(bool enabled) { sGlobalInheritRt.store(enabled, std::memory_order_release); } pid_t BBinder::getDebugPid() { #ifdef __linux__ return getpid(); Loading Loading @@ -744,7 +751,7 @@ BBinder::~BBinder() if (isRequestingSid()) { ALOGW("Binder %p destroyed when requesting SID before being parceled.", this); } if (isInheritRt()) { if (sGlobalInheritRt.load(std::memory_order_acquire) != isInheritRt()) { ALOGW("Binder %p destroyed after setInheritRt before being parceled.", this); } #ifdef __linux__ Loading
libs/binder/include/binder/Binder.h +7 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,11 @@ public: // This must be called before the object is sent to another process. Not thread safe. LIBBINDER_EXPORTED void setInheritRt(bool inheritRt); // Set default, overridden by setInheritRt. You must set this default early. // Any binder objects sent out of the process before this is called will // not use the updated value. LIBBINDER_EXPORTED static void setGlobalInheritRt(bool enabled); LIBBINDER_EXPORTED pid_t getDebugPid(); // Whether this binder has been sent to another process. Loading Loading @@ -124,6 +129,8 @@ private: [[nodiscard]] status_t startRecordingTransactions(const Parcel& data); [[nodiscard]] status_t stopRecordingTransactions(); static std::atomic<bool> sGlobalInheritRt; std::atomic<Extras*> mExtras; friend ::android::internal::Stability; Loading