xv6-riscv-rust/theseus/src/spinlock.rs

10 lines
235 B
Rust

// Mutual exclusion lock.
#[repr(C)]
pub struct SpinLock {
// Is the lock held?
pub locked: u32, // C boolean
// For debugging:
pub name: Option<*mut ()>, // Name of lock.
pub cpu: Option<*mut ()>, // The cpu holding the lock.
}