Automatically start threadpool.
Generated code should automatically start a threadpool
in one of the following scenarios:
- You pass an asynchronous interface to a remote process
(so you can receive calls on it).
- You register a death recipient on an interface
(so the kernel can notify you on this thread when it dies).
Also, updated tests to use the new configure/joinThreadPool() API.
Bug: 31748996
Test: mma, hidl_test, hidl_test_java
Change-Id: I2262580282c9b25c2e004dfd928b7444f4be78d9
diff --git a/Interface.cpp b/Interface.cpp
index 1e40bd2..7183ba8 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -89,6 +89,7 @@
},
{IMPL_PROXY,
[](auto &out) {
+ out << "::android::hardware::ProcessState::self()->startThreadPool();\n";
out << "::android::hardware::hidl_binder_death_recipient *binder_recipient"
<< " = new ::android::hardware::hidl_binder_death_recipient(recipient, cookie, this);\n"
<< "std::unique_lock<std::mutex> lock(_hidl_mMutex);\n"