[*] These atomic set utils were stupid
This commit is contained in:
parent
58ffac4672
commit
f081fc6242
@ -377,16 +377,31 @@ inline auline bool AuAtomicUtils<AuInt64>::TestAndSet(AuInt64 *in, const AuUInt8
|
||||
|
||||
template <class T>
|
||||
auline
|
||||
T AuAtomicSet(T *in, AuUInt8 offset)
|
||||
T AuAtomicOrSetBit(T *in, AuUInt8 offset)
|
||||
{
|
||||
return AuAtomicUtils<T>::Set(in, offset);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
auline
|
||||
bool AuAtomicSet(T *in, AuUInt8 offset)
|
||||
{
|
||||
return AuAtomicOrSetBit(in, offset) & (T(1) << offset);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
auline
|
||||
T AuAtomicAndUnsetBit(T *in, AuUInt8 offset)
|
||||
{
|
||||
return AuAtomicUtils<T>::And(in, ~(T(1) << T(offset)));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
auline
|
||||
bool AuAtomicUnset(T *in, AuUInt8 offset)
|
||||
{
|
||||
return AuAtomicUtils<T>::And(in, ~(1u << AuUInt32(offset))) != 0;
|
||||
auto uBit = T(1) << T(offset);
|
||||
return AuAtomicUtils<T>::And(in, ~(uBit)) & uBit;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
Loading…
Reference in New Issue
Block a user