Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls (#44653)

Summary:
Fixes https://github.com/facebook/react-native/issues/44649.

## Changelog:

[IOS] [FIXED] - Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls

Pull Request resolved: https://github.com/facebook/react-native/pull/44653

Test Plan: Demo in https://github.com/facebook/react-native/issues/44649.

Reviewed By: fabriziocucci

Differential Revision: D57727886

Pulled By: sammy-SC

fbshipit-source-id: 967e2d8452cc477f2225151a46e9aa27698f4506
This commit is contained in:
zhongwuzw
2024-05-23 11:11:27 -07:00
committed by Facebook GitHub Bot
parent 33b064bb9c
commit 3f74f69cf0
@@ -101,7 +101,7 @@ class JsToNativeBridge : public react::ExecutorDelegate {
// executor is destroyed synchronously on its queue.
std::shared_ptr<ModuleRegistry> m_registry;
std::shared_ptr<InstanceCallback> m_callback;
bool m_batchHadNativeModuleOrTurboModuleCalls = false;
std::atomic<bool> m_batchHadNativeModuleOrTurboModuleCalls{false};
};
NativeToJsBridge::NativeToJsBridge(