Make gBn/sConstructorMap concurrent.
Test: builds
Test: hidl_test
Bug: 35041785
Change-Id: I60099ddd56fee1faec7e54245d0fa3ccae6e777a
diff --git a/transport/include/hidl/Static.h b/transport/include/hidl/Static.h
index 1f6fa9f..d62d675 100644
--- a/transport/include/hidl/Static.h
+++ b/transport/include/hidl/Static.h
@@ -19,6 +19,7 @@
#include <android/hidl/base/1.0/IBase.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <hidl/ConcurrentMap.h>
#include <hwbinder/IBinder.h>
#include <utils/threads.h>
@@ -32,14 +33,14 @@
// For HidlBinderSupport
// value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
// returns sp<IBinder>
-extern std::map<std::string, std::function<sp<IBinder>(void *)>>
- gBnConstructorMap;
+extern ConcurrentMap<std::string,
+ std::function<sp<IBinder>(void *)>> gBnConstructorMap;
// For HidlPassthroughSupport
// value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
// returns sp<IBase>
-extern std::map<std::string, std::function<sp<::android::hidl::base::V1_0::IBase>(void *)>>
- gBsConstructorMap;
+extern ConcurrentMap<std::string,
+ std::function<sp<::android::hidl::base::V1_0::IBase>(void *)>> gBsConstructorMap;
} // namespace hardware
} // namespace android