Bug 1153394 - make HangMonitorChild::sInstance an atomic variable; r=billm
authorNathan Froyd <froydnj@mozilla.com>
Fri, 11 Sep 2015 19:24:53 -0400
changeset 294974 c425e00cb6c5431550756a50aeb93230117b53da
parent 294973 b3f5c61b22ee65a236d04bdbbc4a3aa71c34435c
child 294975 13dc20d39faec37148234c5e2eb493be3a407ba5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1153394
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1153394 - make HangMonitorChild::sInstance an atomic variable; r=billm
dom/ipc/ProcessHangMonitor.cpp
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -101,17 +101,17 @@ class HangMonitorChild
 
   static HangMonitorChild* Get() { return sInstance; }
 
   MessageLoop* MonitorLoop() { return mHangMonitor->MonitorLoop(); }
 
  private:
   void ShutdownOnThread();
 
-  static HangMonitorChild* sInstance;
+  static Atomic<HangMonitorChild*> sInstance;
 
   const nsRefPtr<ProcessHangMonitor> mHangMonitor;
   Monitor mMonitor;
 
   // Main thread-only.
   bool mSentReport;
 
   // These fields must be accessed with mMonitor held.
@@ -119,17 +119,17 @@ class HangMonitorChild
   bool mStartDebugger;
   bool mFinishedStartingDebugger;
   bool mShutdownDone;
 
   // This field is only accessed on the hang thread.
   bool mIPCOpen;
 };
 
-HangMonitorChild* HangMonitorChild::sInstance;
+Atomic<HangMonitorChild*> HangMonitorChild::sInstance;
 
 /* Parent process objects */
 
 class HangMonitorParent;
 
 class HangMonitoredProcess final
   : public nsIHangReport
 {