1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

AK: Add default memory order as template argument for Atomic<T>

This is useful for collecting statistics, e.g.
Atomic<unsigned, MemoryOrder::memory_order_relaxed> would allow
using operators such as ++ to use relaxed semantics throughout
without having to explicitly call fetch_add with the memory order.
This commit is contained in:
Tom 2021-01-03 16:43:10 -07:00 committed by Andreas Kling
parent a6c459dd29
commit fb84f0ec9c
3 changed files with 38 additions and 30 deletions

View file

@ -70,7 +70,7 @@ class SimpleIterator;
using ReadonlyBytes = Span<const u8>;
using Bytes = Span<u8>;
template<typename T>
template<typename T, AK::MemoryOrder DefaultMemoryOrder>
class Atomic;
template<typename T>