Make sure that ReactFeatureFlags.useTurboModules is read from memory

Summary:
`ReactFeatureFlags.useTurboModules` can be written to and read from any number of threads. We should use `volatile` to make sure that all threads read/write this data straight from/to memory.

Changelog:
[Android][Fixed] - Make ReactFeatureFlags.useTurboModules volatile

Reviewed By: fkgozali

Differential Revision: D18505673

fbshipit-source-id: 0b2527b8cb95c1e1aedc6b03b12a6b1e6a6cdaa4
This commit is contained in:
Ramanpreet Nara
2019-11-14 11:03:59 -08:00
committed by Facebook Github Bot
parent ec59e60d45
commit 7f637139e7
@@ -26,11 +26,11 @@ public class ReactFeatureFlags {
public static boolean useMapNativeAccessor = false;
/**
* Should this application use TurboModules. If yes, then any module that inherits {@link
* Should this application use TurboModules? If yes, then any module that inherits {@link
* com.facebook.react.turbomodule.core.interfaces.TurboModule} will NOT be passed in to C++
* CatalystInstanceImpl
*/
public static boolean useTurboModules = false;
public static volatile boolean useTurboModules = false;
/**
* Log tags of when a view deleted on the native side {@link