Merge "Fix 2 instances of buggy double check locking on non-volatile fields."

This commit is contained in:
Ian Rogers
2016-05-19 05:19:28 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -378,7 +378,7 @@ public class EventBus extends BroadcastReceiver {
// Used for initializing the default bus
private static final Object sLock = new Object();
private static EventBus sDefaultBus;
private static volatile EventBus sDefaultBus;
// The handler to post all events
private Handler mHandler;

View File

@@ -68,7 +68,7 @@ class NetworkStatsObservers {
private final AtomicInteger mNextDataUsageRequestId = new AtomicInteger();
// Lazily instantiated when an observer is registered.
private Handler mHandler;
private volatile Handler mHandler;
/**
* Creates a wrapper that contains the caller context and a normalized request.