Spin lock initializer
This commit is contained in:
parent
aaa595dbb7
commit
6b76570afd
|
@ -10,6 +10,8 @@ typedef struct {
|
||||||
volatile atomic_flag flag;
|
volatile atomic_flag flag;
|
||||||
} SpinLock;
|
} SpinLock;
|
||||||
|
|
||||||
|
#define SPIN_LOCK_UNLOCKED (SpinLock) { .flag = ATOMIC_FLAG_INIT }
|
||||||
|
|
||||||
HEADER_FN bool
|
HEADER_FN bool
|
||||||
spin_lock_try_acquire(SpinLock *lock)
|
spin_lock_try_acquire(SpinLock *lock)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue