Loading libs/binder/RpcSession.cpp +11 −10 Original line number Diff line number Diff line Loading @@ -699,10 +699,7 @@ status_t RpcSession::addOutgoingConnection(std::unique_ptr<RpcTransport> rpcTran mRpcBinderState->sendConnectionInit(connection, sp<RpcSession>::fromExisting(this)); } { std::lock_guard<std::mutex> _l(mMutex); connection->exclusiveTid = std::nullopt; } clearConnectionTid(connection); return status; } Loading Loading @@ -773,6 +770,15 @@ bool RpcSession::removeIncomingConnection(const sp<RpcConnection>& connection) { return false; } void RpcSession::clearConnectionTid(const sp<RpcConnection>& connection) { std::unique_lock<std::mutex> _l(mMutex); connection->exclusiveTid = std::nullopt; if (mConnections.mWaitingThreads > 0) { _l.unlock(); mAvailableConnectionCv.notify_one(); } } std::vector<uint8_t> RpcSession::getCertificate(RpcCertificateFormat format) { return mCtx->getCertificate(format); } Loading Loading @@ -902,12 +908,7 @@ RpcSession::ExclusiveConnection::~ExclusiveConnection() { // is using this fd, and it retains the right to it. So, we don't give up // exclusive ownership, and no thread is freed. if (!mReentrant && mConnection != nullptr) { std::unique_lock<std::mutex> _l(mSession->mMutex); mConnection->exclusiveTid = std::nullopt; if (mSession->mConnections.mWaitingThreads > 0) { _l.unlock(); mSession->mAvailableConnectionCv.notify_one(); } mSession->clearConnectionTid(mConnection); } } Loading libs/binder/include/binder/RpcSession.h +1 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,7 @@ private: sp<RpcConnection> assignIncomingConnectionToThisThread( std::unique_ptr<RpcTransport> rpcTransport); [[nodiscard]] bool removeIncomingConnection(const sp<RpcConnection>& connection); void clearConnectionTid(const sp<RpcConnection>& connection); [[nodiscard]] status_t initShutdownTrigger(); Loading Loading
libs/binder/RpcSession.cpp +11 −10 Original line number Diff line number Diff line Loading @@ -699,10 +699,7 @@ status_t RpcSession::addOutgoingConnection(std::unique_ptr<RpcTransport> rpcTran mRpcBinderState->sendConnectionInit(connection, sp<RpcSession>::fromExisting(this)); } { std::lock_guard<std::mutex> _l(mMutex); connection->exclusiveTid = std::nullopt; } clearConnectionTid(connection); return status; } Loading Loading @@ -773,6 +770,15 @@ bool RpcSession::removeIncomingConnection(const sp<RpcConnection>& connection) { return false; } void RpcSession::clearConnectionTid(const sp<RpcConnection>& connection) { std::unique_lock<std::mutex> _l(mMutex); connection->exclusiveTid = std::nullopt; if (mConnections.mWaitingThreads > 0) { _l.unlock(); mAvailableConnectionCv.notify_one(); } } std::vector<uint8_t> RpcSession::getCertificate(RpcCertificateFormat format) { return mCtx->getCertificate(format); } Loading Loading @@ -902,12 +908,7 @@ RpcSession::ExclusiveConnection::~ExclusiveConnection() { // is using this fd, and it retains the right to it. So, we don't give up // exclusive ownership, and no thread is freed. if (!mReentrant && mConnection != nullptr) { std::unique_lock<std::mutex> _l(mSession->mMutex); mConnection->exclusiveTid = std::nullopt; if (mSession->mConnections.mWaitingThreads > 0) { _l.unlock(); mSession->mAvailableConnectionCv.notify_one(); } mSession->clearConnectionTid(mConnection); } } Loading
libs/binder/include/binder/RpcSession.h +1 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,7 @@ private: sp<RpcConnection> assignIncomingConnectionToThisThread( std::unique_ptr<RpcTransport> rpcTransport); [[nodiscard]] bool removeIncomingConnection(const sp<RpcConnection>& connection); void clearConnectionTid(const sp<RpcConnection>& connection); [[nodiscard]] status_t initShutdownTrigger(); Loading