#include <oskit/machine/spin_lock.h>
This file provides the architecture-dependent definition of the spin_lock_t ``spin lock'' data type and associated manipulation macros. This facility provides a basic locking mechanism which can be used with preemptive threading or on a multi-processor.
- spin_lock_t
- Typedef for the spin lock data type.
- spin_lock_init(s)
- Initialize a spin lock.
- spin_lock_locked(s)
- Check if a spin lock is locked.
- spin_unlock(s)
- Unlock a spin lock.
- spin_try_lock(s)
- Attempt to lock a spin lock. Returns 0 if successful, nonzero if unsuccessful.
- spin_lock(s)
- Busy wait until the lock is free. On return the lock has been acquired.
This header file is taken from CMU's Mach kernel.