Bug 1203658 - mark Linux's nsNotifyAddrListener::mChildThreadShutdown member as Atomic; r=bagder
authorNathan Froyd <froydnj@mozilla.com>
Thu, 10 Sep 2015 23:53:42 -0400
changeset 297175 fd29f486b3e308a8d2d77e1e33e6a5e21a1ce74a
parent 297174 adac35e4feeb83a99a4476df70bb16766f4ab203
child 297176 51994c27948c7255ae448d126a53a6308fa14ab0
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1203658
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 1203658 - mark Linux's nsNotifyAddrListener::mChildThreadShutdown member as Atomic; r=bagder Relaxed memory consistency here is OK; the only concern here is that the child thread eventually goes away, not that it does so immediately after we've signaled that it should go away.
netwerk/system/linux/nsNotifyAddrListener_Linux.h
--- a/netwerk/system/linux/nsNotifyAddrListener_Linux.h
+++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.h
@@ -15,16 +15,17 @@
 #include <arpa/inet.h>
 #include <unistd.h>
 
 #include "nsINetworkLinkService.h"
 #include "nsIRunnable.h"
 #include "nsIObserver.h"
 #include "nsThreadUtils.h"
 #include "nsCOMPtr.h"
+#include "mozilla/Atomics.h"
 #include "mozilla/TimeStamp.h"
 
 class nsNotifyAddrListener : public nsINetworkLinkService,
                              public nsIRunnable,
                              public nsIObserver
 {
     virtual ~nsNotifyAddrListener();
 
@@ -71,12 +72,12 @@ private:
 
     // A pipe to signal shutdown with.
     int mShutdownPipe[2];
 
     // Network changed events are enabled
     bool mAllowChangedEvent;
 
     // Flag to signal child thread kill with
-    bool mChildThreadShutdown;
+    mozilla::Atomic<bool, mozilla::Relaxed> mChildThreadShutdown;
 };
 
 #endif /* NSNOTIFYADDRLISTENER_LINUX_H_ */