From 74a5445453d828fd65d003a92f058f660293fde1 Mon Sep 17 00:00:00 2001 From: Andrei Homescu Date: Fri, 10 Dec 2021 05:30:21 +0000 Subject: libbinder: build on Trusty Adds a new trusty/ subdirectory containing all the files needed to build Binder RPC on Trusty, including: * A RpcServerTrusty class used to create Trusty Binder services * The underlying RpcTransportTipcTrusty transport that interfaces between libbinder and TIPC * Trusty implementations of some OS-specific functionality, like logging * Make-based build file for libbinder in the Trusty build system Bug: 224644083 Test: build Trusty Change-Id: I25b97736d41489d20c2dd266e8e110764215378c --- libs/binder/RpcServer.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libs/binder/RpcServer.cpp') diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 096d5cc5ad..49be4dd9eb 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -209,9 +209,10 @@ void RpcServer::join() { { RpcMutexLockGuard _l(mLock); - RpcMaybeThread thread = RpcMaybeThread(&RpcServer::establishConnection, - sp::fromExisting(this), - std::move(clientFd), addr, addrLen); + RpcMaybeThread thread = + RpcMaybeThread(&RpcServer::establishConnection, + sp::fromExisting(this), std::move(clientFd), addr, + addrLen, RpcSession::join); auto& threadRef = mConnectingThreads[thread.get_id()]; threadRef = std::move(thread); @@ -294,8 +295,10 @@ size_t RpcServer::numUninitializedSessions() { return mConnectingThreads.size(); } -void RpcServer::establishConnection(sp&& server, base::unique_fd clientFd, - std::array addr, size_t addrLen) { +void RpcServer::establishConnection( + sp&& server, base::unique_fd clientFd, std::array addr, + size_t addrLen, + std::function&&, RpcSession::PreJoinSetupResult&&)>&& joinFn) { // mShutdownTrigger can only be cleared once connection threads have joined. // It must be set before this thread is started LOG_ALWAYS_FATAL_IF(server->mShutdownTrigger == nullptr); @@ -478,7 +481,7 @@ void RpcServer::establishConnection(sp&& server, base::unique_fd clie // avoid strong cycle server = nullptr; - RpcSession::join(std::move(session), std::move(setupResult)); + joinFn(std::move(session), std::move(setupResult)); } status_t RpcServer::setupSocketServer(const RpcSocketAddress& addr) { -- cgit v1.2.3-59-g8ed1b