diff options
author | Ian Moffett <ian@osmora.org> | 2025-04-17 00:42:57 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-04-17 00:42:57 -0400 |
commit | b1642ad065b04f452227bff58e951f67fb4cec47 (patch) | |
tree | c08f9f6845fc8692dbbc7bb2babfd15bae957731 /sys/include | |
parent | b258732b39547eb81897a58a070324b7ca552023 (diff) |
kernel: synch: Add lazy spinlock acquire
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/sys/spinlock.h | 4 |
1 files changed, 3 insertions, 1 deletions
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 <sys/types.h> 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 |