Loading libs/binder/RpcServer.cpp +16 −21 Original line number Diff line number Diff line Loading @@ -153,35 +153,30 @@ void RpcServer::join() { status_t status; while ((status = mShutdownTrigger->triggerablePollRead(mServer)) == OK) { (void)acceptOne(); } LOG_RPC_DETAIL("RpcServer::join exiting with %s", statusToString(status).c_str()); { std::lock_guard<std::mutex> _l(mLock); mJoinThreadRunning = false; } mShutdownCv.notify_all(); } bool RpcServer::acceptOne() { unique_fd clientFd( TEMP_FAILURE_RETRY(accept4(mServer.get(), nullptr, nullptr /*length*/, SOCK_CLOEXEC))); unique_fd clientFd(TEMP_FAILURE_RETRY( accept4(mServer.get(), nullptr, nullptr /*length*/, SOCK_CLOEXEC))); if (clientFd < 0) { ALOGE("Could not accept4 socket: %s", strerror(errno)); return false; continue; } LOG_RPC_DETAIL("accept4 on fd %d yields fd %d", mServer.get(), clientFd.get()); { std::lock_guard<std::mutex> _l(mLock); std::thread thread = std::thread(&RpcServer::establishConnection, sp<RpcServer>::fromExisting(this), std::move(clientFd)); std::thread thread = std::thread(&RpcServer::establishConnection, sp<RpcServer>::fromExisting(this), std::move(clientFd)); mConnectingThreads[thread.get_id()] = std::move(thread); } } LOG_RPC_DETAIL("RpcServer::join exiting with %s", statusToString(status).c_str()); return true; { std::lock_guard<std::mutex> _l(mLock); mJoinThreadRunning = false; } mShutdownCv.notify_all(); } bool RpcServer::shutdown() { Loading libs/binder/include/binder/RpcServer.h +0 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ private: static void establishConnection(sp<RpcServer>&& server, base::unique_fd clientFd); bool setupSocketServer(const RpcSocketAddress& address); [[nodiscard]] bool acceptOne(); bool mAgreedExperimental = false; size_t mMaxThreads = 1; Loading Loading
libs/binder/RpcServer.cpp +16 −21 Original line number Diff line number Diff line Loading @@ -153,35 +153,30 @@ void RpcServer::join() { status_t status; while ((status = mShutdownTrigger->triggerablePollRead(mServer)) == OK) { (void)acceptOne(); } LOG_RPC_DETAIL("RpcServer::join exiting with %s", statusToString(status).c_str()); { std::lock_guard<std::mutex> _l(mLock); mJoinThreadRunning = false; } mShutdownCv.notify_all(); } bool RpcServer::acceptOne() { unique_fd clientFd( TEMP_FAILURE_RETRY(accept4(mServer.get(), nullptr, nullptr /*length*/, SOCK_CLOEXEC))); unique_fd clientFd(TEMP_FAILURE_RETRY( accept4(mServer.get(), nullptr, nullptr /*length*/, SOCK_CLOEXEC))); if (clientFd < 0) { ALOGE("Could not accept4 socket: %s", strerror(errno)); return false; continue; } LOG_RPC_DETAIL("accept4 on fd %d yields fd %d", mServer.get(), clientFd.get()); { std::lock_guard<std::mutex> _l(mLock); std::thread thread = std::thread(&RpcServer::establishConnection, sp<RpcServer>::fromExisting(this), std::move(clientFd)); std::thread thread = std::thread(&RpcServer::establishConnection, sp<RpcServer>::fromExisting(this), std::move(clientFd)); mConnectingThreads[thread.get_id()] = std::move(thread); } } LOG_RPC_DETAIL("RpcServer::join exiting with %s", statusToString(status).c_str()); return true; { std::lock_guard<std::mutex> _l(mLock); mJoinThreadRunning = false; } mShutdownCv.notify_all(); } bool RpcServer::shutdown() { Loading
libs/binder/include/binder/RpcServer.h +0 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ private: static void establishConnection(sp<RpcServer>&& server, base::unique_fd clientFd); bool setupSocketServer(const RpcSocketAddress& address); [[nodiscard]] bool acceptOne(); bool mAgreedExperimental = false; size_t mMaxThreads = 1; Loading