Loading libs/binder/RpcServer.cpp +3 −9 Original line number Original line Diff line number Diff line Loading @@ -258,18 +258,12 @@ void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clie LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), "Must establish connection on owned thread"); "Must establish connection on owned thread"); thisThread = std::move(threadId->second); thisThread = std::move(threadId->second); ScopeGuard detachGuard = [&]() { thisThread.detach(); }; ScopeGuard detachGuard = [&]() { server->mConnectingThreads.erase(threadId); thisThread.detach(); // 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 = [&]() { _l.unlock(); _l.unlock(); server->mShutdownCv.notify_all(); server->mShutdownCv.notify_all(); }; }; server->mConnectingThreads.erase(threadId); if (!idValid) { if (!idValid) { return; return; Loading Loading
libs/binder/RpcServer.cpp +3 −9 Original line number Original line Diff line number Diff line Loading @@ -258,18 +258,12 @@ void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clie LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), "Must establish connection on owned thread"); "Must establish connection on owned thread"); thisThread = std::move(threadId->second); thisThread = std::move(threadId->second); ScopeGuard detachGuard = [&]() { thisThread.detach(); }; ScopeGuard detachGuard = [&]() { server->mConnectingThreads.erase(threadId); thisThread.detach(); // 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 = [&]() { _l.unlock(); _l.unlock(); server->mShutdownCv.notify_all(); server->mShutdownCv.notify_all(); }; }; server->mConnectingThreads.erase(threadId); if (!idValid) { if (!idValid) { return; return; Loading