diff options
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 8037f0863c..1ba20b3103 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -25,7 +25,7 @@ #include <thread> #include <vector> -#include <android-base/scopeguard.h> +#include <binder/Functional.h> #include <binder/Parcel.h> #include <binder/RpcServer.h> #include <binder/RpcTransportRaw.h> @@ -44,7 +44,7 @@ namespace android { constexpr size_t kSessionIdBytes = 32; -using base::ScopeGuard; +using namespace android::binder::impl; using base::unique_fd; RpcServer::RpcServer(std::unique_ptr<RpcTransportCtx> ctx) : mCtx(std::move(ctx)) {} @@ -454,11 +454,12 @@ void RpcServer::establishConnection( LOG_ALWAYS_FATAL_IF(threadId == server->mConnectingThreads.end(), "Must establish connection on owned thread"); thisThread = std::move(threadId->second); - ScopeGuard detachGuard = [&]() { + auto detachGuardLambda = [&]() { thisThread.detach(); _l.unlock(); server->mShutdownCv.notify_all(); }; + auto detachGuard = make_scope_guard(std::ref(detachGuardLambda)); server->mConnectingThreads.erase(threadId); if (status != OK || server->mShutdownTrigger->isTriggered()) { @@ -544,7 +545,7 @@ void RpcServer::establishConnection( return; } - detachGuard.Disable(); + detachGuard.release(); session->preJoinThreadOwnership(std::move(thisThread)); } |