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:
Emily Janzer
2019-10-04 11:00:08 -07:00
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;