Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1407137 - Implement Swap(Atomic<T, Order>&, Atomic<T, Order>&) = …
Browse files Browse the repository at this point in the history
…delete; to remove an actually-non-atomic footgun. r=froydnj
  • Loading branch information
jswalden committed Oct 10, 2017
1 parent 6cd32e0 commit 06a00d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mfbt/Atomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ class Atomic<bool, Order>
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 */

0 comments on commit 06a00d3

Please sign in to comment.