Merge "Better errors for configureBinderRpcThreadpool." am: 3eb12e4372 am: 278c3e85f5
am: f3ed712671
Change-Id: Idc21f44b54009ad97c92c262f67065413c650bb0
diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp
index d884544..4a24a3e 100644
--- a/transport/HidlBinderSupport.cpp
+++ b/transport/HidlBinderSupport.cpp
@@ -196,11 +196,21 @@
return status;
}
+static bool gThreadPoolConfigured = false;
+
void configureBinderRpcThreadpool(size_t maxThreads, bool callerWillJoin) {
- ProcessState::self()->setThreadPoolConfiguration(maxThreads, callerWillJoin /*callerJoinsPool*/);
+ status_t ret = ProcessState::self()->setThreadPoolConfiguration(
+ maxThreads, callerWillJoin /*callerJoinsPool*/);
+ LOG_ALWAYS_FATAL_IF(ret != OK, "Could not setThreadPoolConfiguration: %d", ret);
+
+ gThreadPoolConfigured = true;
}
void joinBinderRpcThreadpool() {
+ if (!gThreadPoolConfigured) {
+ ALOGE("HIDL joinRpcThreadpool without calling configureRpcThreadPool.");
+ }
+
IPCThreadState::self()->joinThreadPool();
}