tried relaxing atomic operations

This commit is contained in:
joaquintides
2023-03-22 19:24:46 +01:00
parent 0b2829c793
commit 44b918896d

View File

@ -144,10 +144,10 @@ private:
template<typename Integral>
struct atomic_integral
{
operator Integral()const{return n.load(std::memory_order_acquire);}
void operator=(Integral m){n.store(m,std::memory_order_release);}
void operator|=(Integral m){n.fetch_or(m,std::memory_order_acq_rel);}
void operator&=(Integral m){n.fetch_and(m,std::memory_order_acq_rel);}
operator Integral()const{return n.load(std::memory_order_relaxed);}
void operator=(Integral m){n.store(m,std::memory_order_relaxed);}
void operator|=(Integral m){n.fetch_or(m,std::memory_order_relaxed);}
void operator&=(Integral m){n.fetch_and(m,std::memory_order_relaxed);}
std::atomic<Integral> n;
};