Backed out changeset 80e9cd4126b4 (bug 1397052) for adding a hazard to the build a=backout
authorWes Kocher <wkocher@mozilla.com>
Wed, 06 Sep 2017 13:54:07 -0700
changeset 660385 6169c1d97aab3ef1fcad843619916040fe698e96
parent 660384 9b0cf253ad1f40a5fd284524a38c4976100abfcc
child 660386 74131a35a149450b24ca17d4bde05abee558a99f
push id78390
push userbmo:emilio@crisal.io
push dateWed, 06 Sep 2017 23:04:15 +0000
reviewersbackout
bugs1397052
milestone57.0a1
backs out80e9cd4126b49eedcbd9310407997ec429bdc769
Backed out changeset 80e9cd4126b4 (bug 1397052) for adding a hazard to the build a=backout MozReview-Commit-ID: I5ZLNHEfj1j
xpcom/base/nsISupportsImpl.h
--- a/xpcom/base/nsISupportsImpl.h
+++ b/xpcom/base/nsISupportsImpl.h
@@ -352,17 +352,17 @@ public:
     // to the thread that destroys the object when it reads mValue with
     // acquire semantics.
     nsrefcnt result = mValue.fetch_sub(1, std::memory_order_release) - 1;
     if (result == 0) {
       // We're going to destroy the object on this thread, so we need
       // acquire semantics to synchronize with the memory released by
       // the last release on other threads, that is, to ensure that
       // writes prior to that release are now visible on this thread.
-      std::atomic_thread_fence(std::memory_order_acquire);
+      result = mValue.load(std::memory_order_acquire);
     }
     return result;
   }
 
   MOZ_ALWAYS_INLINE nsrefcnt operator=(nsrefcnt aValue)
   {
     // Use release semantics since we're not sure what the caller is
     // doing.