From 6b76570afd6baea3a795047be5da1aa74bfe7a5f Mon Sep 17 00:00:00 2001 From: Vftdan Date: Fri, 25 Oct 2024 01:38:26 +0200 Subject: [PATCH] Spin lock initializer --- src/common/util/spin_lock.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/util/spin_lock.h b/src/common/util/spin_lock.h index 3b16d5c..93695b1 100644 --- a/src/common/util/spin_lock.h +++ b/src/common/util/spin_lock.h @@ -10,6 +10,8 @@ typedef struct { volatile atomic_flag flag; } SpinLock; +#define SPIN_LOCK_UNLOCKED (SpinLock) { .flag = ATOMIC_FLAG_INIT } + HEADER_FN bool spin_lock_try_acquire(SpinLock *lock) {