diff options
author | 2021-05-25 22:39:46 +0000 | |
---|---|---|
committer | 2021-05-25 22:39:46 +0000 | |
commit | 385b6612662bbf61d1f5aa4f4f71c91982fb5a1c (patch) | |
tree | d65a264f96eaa407ab5f35359fad4daf065b438b /libs/binder/RpcServer.cpp | |
parent | 495a84db0609cc318ddf6ff166de12b67651bbb6 (diff) | |
parent | adc5dca8f86524a5b9e5561d357b7847a2a58a1e (diff) |
Merge "libbinder: RPC save notify on transferring thread"
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 93f970946a..d8ba2c6a04 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -258,18 +258,12 @@ void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clie LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), "Must establish connection on owned thread"); thisThread = std::move(threadId->second); - ScopeGuard detachGuard = [&]() { thisThread.detach(); }; - server->mConnectingThreads.erase(threadId); - - // TODO(b/185167543): we currently can't disable this because we don't - // shutdown sessions as well, only the server itself. So, we need to - // keep this separate from the detachGuard, since we temporarily want to - // give a notification even when we pass ownership of the thread to - // a session. - ScopeGuard threadLifetimeGuard = [&]() { + ScopeGuard detachGuard = [&]() { + thisThread.detach(); _l.unlock(); server->mShutdownCv.notify_all(); }; + server->mConnectingThreads.erase(threadId); if (!idValid) { return; |