Backed out changeset 80e9cd4126b4 (
bug 1397052) for adding a hazard to the build a=backout
MozReview-Commit-ID: I5ZLNHEfj1j
--- 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.