power_play/src/base/base_futex.h

23 lines
883 B
C

////////////////////////////////////////////////////////////
//~ @hookdecl Not-equal futex operations
/* Similar to Win32 WaitOnAddress & WakeByAddressAll
* i.e. - Suprious wait until value at address != cmp */
void FutexYieldNeq(volatile void *addr, void *cmp, u8 cmp_size);
void FutexWakeNeq(void *addr);
////////////////////////////////////////////////////////////
//~ @hookdecl Greater-than-or-equal futex operations
/* Similar to Win32 WaitOnAddress & WakeByAddressAll
* i.e. - Spurious wait until monotonically increasing value at address >= cmp (used for fences)
*
* NOTE: This API is offered for fence-like semantics, where waiters only want to
* wake when the futex progresses past the specified target value, rather than
* wake every time the futex is modified.
*/
void FutexYieldGte(volatile void *addr, void *cmp, u8 cmp_size);
void FutexWakeGte(void *addr);