Make gBn/sConstructorMap concurrent.
Test: builds
Test: hidl_test
Bug: 35041785
Change-Id: I60099ddd56fee1faec7e54245d0fa3ccae6e777a
diff --git a/transport/include/hidl/HidlBinderSupport.h b/transport/include/hidl/HidlBinderSupport.h
index fb0b1f0..2fff6cb 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -328,11 +328,11 @@
// interfaceChain fails
return nullptr;
}
- auto iter = gBnConstructorMap.find(myDescriptor);
- if (iter == gBnConstructorMap.end()) {
+ auto func = gBnConstructorMap.get(myDescriptor, nullptr);
+ if (!func) {
return nullptr;
}
- return sp<IBinder>((iter->second)(reinterpret_cast<void *>(ifacePtr)));
+ return sp<IBinder>(func(reinterpret_cast<void *>(ifacePtr)));
}
}