diff options
author | 2021-05-26 17:43:53 +0000 | |
---|---|---|
committer | 2021-05-26 20:50:48 +0000 | |
commit | 85e067bf734fc6f53a836313b968ae2bb345edba (patch) | |
tree | 12bc05925f2d1c525eee16e9006b0993431c0ed8 /libs/binder/RpcSession.cpp | |
parent | bf88c6ff7dc35b6b242ed7045cc0b25da9f98a7c (diff) |
libbinder: update RpcSession 'session' references
Comments and some logs surrounding finding an available connection
were missed in a previous refactor.
Bug: N/A
Test: N/A
Change-Id: I4eda926adc8b2bd946ac59f95faa4ac5b1e22ce9
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index d05b84834f..156a834041 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -379,7 +379,7 @@ RpcSession::ExclusiveConnection::ExclusiveConnection(const sp<RpcSession>& sessi // CHECK FOR DEDICATED CLIENT SOCKET // - // A server/looper should always use a dedicated session if available + // A server/looper should always use a dedicated connection if available findConnection(tid, &exclusive, &available, mSession->mClientConnections, mSession->mClientConnectionsOffset); @@ -407,7 +407,7 @@ RpcSession::ExclusiveConnection::ExclusiveConnection(const sp<RpcSession>& sessi 0 /* index hint */); } - // if our thread is already using a session, prioritize using that + // if our thread is already using a connection, prioritize using that if (exclusive != nullptr) { mConnection = exclusive; mReentrant = true; @@ -420,11 +420,10 @@ RpcSession::ExclusiveConnection::ExclusiveConnection(const sp<RpcSession>& sessi // in regular binder, this would usually be a deadlock :) LOG_ALWAYS_FATAL_IF(mSession->mClientConnections.size() == 0, - "Not a client of any session. You must create a session to an " - "RPC server to make any non-nested (e.g. oneway or on another thread) " - "calls."); + "Session has no client connections. This is required for an RPC server " + "to make any non-nested (e.g. oneway or on another thread) calls."); - LOG_RPC_DETAIL("No available session (have %zu clients and %zu servers). Waiting...", + LOG_RPC_DETAIL("No available connections (have %zu clients and %zu servers). Waiting...", mSession->mClientConnections.size(), mSession->mServerConnections.size()); mSession->mAvailableConnectionCv.wait(_l); } @@ -443,13 +442,13 @@ void RpcSession::ExclusiveConnection::findConnection(pid_t tid, sp<RpcConnection for (size_t i = 0; i < sockets.size(); i++) { sp<RpcConnection>& socket = sockets[(i + socketsIndexHint) % sockets.size()]; - // take first available session (intuition = caching) + // take first available connection (intuition = caching) if (available && *available == nullptr && socket->exclusiveTid == std::nullopt) { *available = socket; continue; } - // though, prefer to take session which is already inuse by this thread + // though, prefer to take connection which is already inuse by this thread // (nested transactions) if (exclusive && socket->exclusiveTid == tid) { *exclusive = socket; @@ -459,7 +458,7 @@ void RpcSession::ExclusiveConnection::findConnection(pid_t tid, sp<RpcConnection } RpcSession::ExclusiveConnection::~ExclusiveConnection() { - // reentrant use of a session means something less deep in the call stack + // reentrant use of a connection means something less deep in the call stack // 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) { |