mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use volatile for sDidInit in ReactBridge
Summary: In D17747958 I added a function to check the value of a static variable, but forgot to make sure it was accessed in a thread-safe manner. Adding `volatile` to the flag Reviewed By: makovkastar Differential Revision: D17763888 fbshipit-source-id: f227b69de1a0df6493424da3b276529555999f70
This commit is contained in:
committed by
Facebook Github Bot
parent
cf7759e6e0
commit
c3a07b6dcc
@@ -16,7 +16,7 @@ public class ReactBridge {
|
||||
private static volatile long sLoadStartTime = 0;
|
||||
private static volatile long sLoadEndTime = 0;
|
||||
|
||||
private static boolean sDidInit = false;
|
||||
private static volatile boolean sDidInit = false;
|
||||
|
||||
public static boolean isInitialized() {
|
||||
return sDidInit;
|
||||
|
||||
Reference in New Issue
Block a user