Compare commits

..

2 Commits

Author SHA1 Message Date
Bananymous c2053ed3dd Kernel: Implement SpinLock without CriticalScope
This actually is not even spinlock since it yields the current
thread. It will become one when I get to SMP though...
2024-01-30 01:07:06 +02:00
Bananymous f3408bb0df BAN: Add compare_exchange to atomic 2024-01-30 01:06:32 +02:00
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ namespace BAN
inline T operator--(int) volatile { return __atomic_fetch_sub(&m_value, 1, MEM_ORDER); }
inline T operator++(int) volatile { return __atomic_fetch_add(&m_value, 1, MEM_ORDER); }
inline bool compare_exchange(T expected, T desired) volatile { return __atomic_compare_exchange_n(&m_value, &expected, desired, false, MEM_ORDER, MEM_ORDER); }
bool compare_exchange(T expected, T desired) volatile { return __atomic_compare_exchange_n(&m_value, &expected, desired, false, MEM_ORDER, MEM_ORDER); }
private:
T m_value;