react-native/React/Base
makadaw 5e97be8b1c Fix data race on read/write _instance variable in ModuleData class
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
XCode  [Thread Sanitizer](https://clang.llvm.org/docs/ThreadSanitizer.html) find race condition while read/write `_instance` variable in RCTModuleData class. A bridge can check `hasInstance` method while instance writes.

All tests passed on my device.
These changes remove data race, you can turn it in scheme configuration ![](https://www.shinobicontrols.com/wp-content/uploads/2016/08/Enable_Sanitizer.png)
Closes https://github.com/facebook/react-native/pull/13757

Differential Revision: D4994041

Pulled By: javache

fbshipit-source-id: 631cd59bbcbde193937d8baf8358ff6868717a2e
2017-05-24 13:01:00 -07:00
..
RCTAssert.h Introducing `RCTAssertUIManagerQueue()` 2017-05-08 12:52:09 -07:00
RCTAssert.m Display JS exceptions and stacks in a red box. 2016-06-30 19:43:28 -07:00
RCTBatchedBridge.mm Fixing Race condition that happens with _wasBatchActive 2017-04-19 03:00:53 -07:00
RCTBridge+JavaScriptCore.h Add JSC utility header to RCTBridge 2017-04-07 11:16:59 -07:00
RCTBridge+Private.h Add block-based initializer for RCTModuleData 2017-04-07 11:16:59 -07:00
RCTBridge.h Add JSC utility header to RCTBridge 2017-04-07 11:16:59 -07:00
RCTBridge.m Switch default bridge to CxxBridge 2017-05-03 14:52:56 -07:00
RCTBridgeDelegate.h Make the choice of bridge based on an optional delegate method 2017-03-21 18:31:23 -07:00
RCTBridgeMethod.h Added support for synchronous methods in native modules on iOS 2017-04-27 12:03:30 -07:00
RCTBridgeModule.h Clean up after recent RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD changes 2017-04-28 05:35:41 -07:00
RCTBundleURLProvider.h allow fetching any resource under js folder via packager 2016-10-20 11:43:44 -07:00
RCTBundleURLProvider.m Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTConvert.h Add display:none support to react native 2017-03-01 09:16:05 -08:00
RCTConvert.m Add display:none support to react native 2017-03-01 09:16:05 -08:00
RCTDefines.h Add RCT_PROFILE define 2016-06-13 04:28:38 -07:00
RCTDisplayLink.h Pull CADisplayLink into a separate file 2016-03-29 19:53:20 -07:00
RCTDisplayLink.m Remove last arg from RCTProfileEnd, make macro's function-like 2016-09-05 11:13:33 -07:00
RCTErrorCustomizer.h Add ability to customize error messages and stacks within the iOS redbox 2016-07-18 11:28:36 -07:00
RCTErrorInfo.h Add ability to customize error messages and stacks within the iOS redbox 2016-07-18 11:28:36 -07:00
RCTErrorInfo.m Add ability to customize error messages and stacks within the iOS redbox 2016-07-18 11:28:36 -07:00
RCTEventDispatcher.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTEventDispatcher.m Dispatch native handled events to JS 2016-11-23 05:43:35 -08:00
RCTFrameUpdate.h
RCTFrameUpdate.m
RCTImageSource.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTImageSource.m Support bundle argument for image loading 2016-08-31 17:43:49 -07:00
RCTInvalidating.h
RCTJSCErrorHandling.h Tease apart React and RCTBatchedBridge targets 2017-03-21 18:31:23 -07:00
RCTJSCErrorHandling.mm More verbose error messages for iOS 2017-04-18 14:19:13 -07:00
RCTJSStackFrame.h Class for JS stack frames instead of dictionaries 2016-07-11 06:13:32 -07:00
RCTJSStackFrame.m Report JS errors in debug console 2017-04-05 19:51:03 -07:00
RCTJavaScriptExecutor.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTJavaScriptLoader.h JavaScriptLoader BCBundle version check 2017-01-11 22:28:43 -08:00
RCTJavaScriptLoader.mm Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
RCTKeyCommands.h Add Shortcut "Double R" to Reload JS in iOS 2016-06-01 03:43:27 -07:00
RCTKeyCommands.m Cleanup warnings 2016-07-12 05:59:12 -07:00
RCTLog.h Replacing all instances of [UIApplication sharedApplication] wi… 2017-04-01 03:34:41 -07:00
RCTLog.mm Replacing all instances of [UIApplication sharedApplication] wi… 2017-04-01 03:34:41 -07:00
RCTModuleData.h Improve constant extraction from RCTNativeModule 2017-04-08 15:18:08 -07:00
RCTModuleData.mm Fix data race on read/write _instance variable in ModuleData class 2017-05-24 13:01:00 -07:00
RCTModuleMethod.h Added support for synchronous methods in native modules on iOS 2017-04-27 12:03:30 -07:00
RCTModuleMethod.m Clean up after recent RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD changes 2017-04-28 05:35:41 -07:00
RCTMultipartDataTask.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTMultipartDataTask.m fix RCTMultipartDataTask Memory leaks 2017-04-20 03:45:25 -07:00
RCTMultipartStreamReader.h Add multipart response stream reader 2016-10-03 18:13:36 -07:00
RCTMultipartStreamReader.m Add multipart response download task (2nd edition) 2016-10-11 12:28:42 -07:00
RCTNullability.h
RCTParserUtils.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTParserUtils.m
RCTPerformanceLogger.h Refactor measuring native requires 2016-09-09 15:28:44 -07:00
RCTPerformanceLogger.m Refactor measuring native requires 2016-09-09 15:28:44 -07:00
RCTPlatform.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTPlatform.m Merge RCTPlatform.isTesting and RCTRunningInTestEnvironment 2017-03-30 10:02:35 -07:00
RCTReloadCommand.h Refactor reload command in React Native 2016-12-07 20:13:22 -08:00
RCTReloadCommand.m Refactor reload command in React Native 2016-12-07 20:13:22 -08:00
RCTRootContentView.h Immediately trigger renderApplication from RCTRootView init 2017-04-21 07:04:57 -07:00
RCTRootContentView.m Immediately trigger renderApplication from RCTRootView init 2017-04-21 07:04:57 -07:00
RCTRootView.h RCTRootView's `intrinsicSize` property was deprecated in favour of `intrinsicContentSize` 2017-02-27 14:04:58 -08:00
RCTRootView.m Use just `_bridge` instead of `batchedBridge` when actual bridge is already batched one 2017-05-03 11:16:31 -07:00
RCTRootViewDelegate.h RCTRootView's `intrinsicSize` property was deprecated in favour of `intrinsicContentSize` 2017-02-27 14:04:58 -08:00
RCTRootViewInternal.h RCTRootView's `intrinsicSize` property was deprecated in favour of `intrinsicContentSize` 2017-02-27 14:04:58 -08:00
RCTTVRemoteHandler.h Apple TV support 4: support for input (tvOS focus engine) 2016-12-19 06:28:40 -08:00
RCTTVRemoteHandler.m Fix warnings in React.xcodeproj 2017-03-23 11:36:17 -07:00
RCTTouchEvent.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTTouchEvent.m New way to handle simultaneously active gesture recognizers in RCTTouchHandler 2017-01-12 12:13:28 -08:00
RCTTouchHandler.h Nobody outside RCTTouchHandler should treat it as UIGestureRecognizer subclass 2017-01-09 00:13:33 -08:00
RCTTouchHandler.m Do not warn if `touch.force` is NaN 2017-04-26 15:16:16 -07:00
RCTURLRequestDelegate.h
RCTURLRequestHandler.h Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
RCTUtils.h Fixed crash caused by NaN values in RCTTouchEvent 2017-04-21 11:30:57 -07:00
RCTUtils.m Avoid presenting on view controller that's being dismissed 2017-04-28 03:30:38 -07:00
RCTWebSocketObserverProtocol.h Expose more of RCTWebSocketObserver 2016-12-08 07:44:38 -08:00