Bug 1407137 - Implement Swap(Atomic<T, Order>&, Atomic<T, Order>&) = delete; to remove an actually-non-atomic footgun. r=froydnj

--HG--
extra : rebase_source : 6afed8e85fcf8801144a1a34ea07f590baa0f5e0
This commit is contained in:
Jeff Walden 2017-10-10 10:19:31 -07:00
parent be56429c85
commit a3d9df23d5

View File

@ -558,6 +558,11 @@ private:
Atomic(Atomic<bool, Order>& aOther) = delete;
};
// If you want to atomically swap two atomic values, use exchange().
template<typename T, MemoryOrdering Order>
void
Swap(Atomic<T, Order>&, Atomic<T, Order>&) = delete;
} // namespace mozilla
#endif /* mozilla_Atomics_h */