Struct rs_lockfree::spin_lock::SpinLock [−][src]
pub struct SpinLock { /* fields omitted */ }
User mode SpinLock
Methods
impl SpinLock
[src]
impl SpinLock
pub fn lock(&mut self)
[src]
pub fn lock(&mut self)
Keep trying to lock until success.
pub unsafe fn lock_guard(&mut self) -> SpinLockGuard
[src]
pub unsafe fn lock_guard(&mut self) -> SpinLockGuard
Keep trying to lock until success, then return SpinLockGuard.
pub fn unlock(&mut self)
[src]
pub fn unlock(&mut self)
Unlock if is locked, else panic.
pub fn is_locked(&self) -> bool
[src]
pub fn is_locked(&self) -> bool
Return true if locked.
pub fn try_lock(&mut self) -> bool
[src]
pub fn try_lock(&mut self) -> bool
Return true if lock successfully.