diff options
author | 2021-05-26 22:52:35 +0000 | |
---|---|---|
committer | 2021-05-26 22:56:22 +0000 | |
commit | a86e8fe5cbb48f683d15ae186cbd0df6797c59c2 (patch) | |
tree | 49bf1049069d24ddb18f9a5570b59b72dcd57db0 /libs/binder/RpcSession.cpp | |
parent | cc5b498dd3100bf31eec230eee63a68dcf7cf96e (diff) |
libbinder: better session termination naming
- removed unused variable/once used function
- name reflects these are server threads exiting
Bug: 185167543
Test: binderRpcTest
Change-Id: Ib5301132213088ec049bf38fc78372655cdc7d9a
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index 156a834041..ccf7f890af 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -219,23 +219,7 @@ void RpcSession::join(unique_fd client) { } if (server != nullptr) { - server->onSessionThreadEnding(sp<RpcSession>::fromExisting(this)); - } -} - -void RpcSession::terminateLocked() { - // TODO(b/185167543): - // - kindly notify other side of the connection of termination (can't be - // locked) - // - prevent new client/servers from being added - // - stop all threads which are currently reading/writing - // - terminate RpcState? - - if (mTerminated) return; - - sp<RpcServer> server = mForServer.promote(); - if (server) { - server->onSessionTerminating(sp<RpcSession>::fromExisting(this)); + server->onSessionServerThreadEnded(sp<RpcSession>::fromExisting(this)); } } @@ -359,7 +343,10 @@ bool RpcSession::removeServerConnection(const sp<RpcConnection>& connection) { it != mServerConnections.end()) { mServerConnections.erase(it); if (mServerConnections.size() == 0) { - terminateLocked(); + sp<RpcServer> server = mForServer.promote(); + if (server) { + server->onSessionLockedAllServerThreadsEnded(sp<RpcSession>::fromExisting(this)); + } } return true; } |