diff options
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index bff5543c9b..93f970946a 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -193,10 +193,12 @@ bool RpcServer::shutdown() { mShutdownTrigger->trigger(); while (mJoinThreadRunning || !mConnectingThreads.empty() || !mSessions.empty()) { - ALOGI("Waiting for RpcServer to shut down. Join thread running: %d, Connecting threads: " - "%zu, Sessions: %zu", - mJoinThreadRunning, mConnectingThreads.size(), mSessions.size()); - mShutdownCv.wait(_l); + if (std::cv_status::timeout == mShutdownCv.wait_for(_l, std::chrono::seconds(1))) { + ALOGE("Waiting for RpcServer to shut down (1s w/o progress). Join thread running: %d, " + "Connecting threads: " + "%zu, Sessions: %zu. Is your server deadlocked?", + mJoinThreadRunning, mConnectingThreads.size(), mSessions.size()); + } } // At this point, we know join() is about to exit, but the thread that calls |