Compare commits

..

2 Commits

Author SHA1 Message Date
Bananymous ca8e7b40bc 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:21:15 +02:00
Bananymous cc79f55817 BAN: Add compare_exchange to atomic 2024-01-30 01:21:15 +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); }
bool compare_exchange(T expected, T desired) volatile { return __atomic_compare_exchange_n(&m_value, &expected, desired, false, MEM_ORDER, 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); }
private:
T m_value;