From b1642ad065b04f452227bff58e951f67fb4cec47 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 17 Apr 2025 00:42:57 -0400 Subject: kernel: synch: Add lazy spinlock acquire Signed-off-by: Ian Moffett --- sys/include/sys/spinlock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/include') diff --git a/sys/include/sys/spinlock.h b/sys/include/sys/spinlock.h index c136e05..b416152 100644 --- a/sys/include/sys/spinlock.h +++ b/sys/include/sys/spinlock.h @@ -33,13 +33,15 @@ #include struct spinlock { - volatile bool lock; + volatile int lock; }; #if defined(_KERNEL) void spinlock_acquire(struct spinlock *lock); void spinlock_release(struct spinlock *lock); + +int spinlock_try_acquire(struct spinlock *lock); int spinlock_usleep(struct spinlock *lock, size_t usec_max); #endif -- cgit v1.2.3