diff --git a/packages/react-native/ReactCommon/react/bridging/LongLivedObject.cpp b/packages/react-native/ReactCommon/react/bridging/LongLivedObject.cpp index 64a93c1b7ec..9c6d7c38d86 100644 --- a/packages/react-native/ReactCommon/react/bridging/LongLivedObject.cpp +++ b/packages/react-native/ReactCommon/react/bridging/LongLivedObject.cpp @@ -16,6 +16,9 @@ LongLivedObjectCollection& LongLivedObjectCollection::get( jsi::Runtime& runtime) { static std::unordered_map> instances; + static std::mutex instancesMutex; + + std::scoped_lock lock(instancesMutex); void* key = static_cast(&runtime); auto entry = instances.find(key); if (entry == instances.end()) {