RawLock

Trait RawLock 

Source
pub trait RawLock {
    // Required methods
    unsafe fn enter(&self) -> RestoreState;
    unsafe fn exit(&self, token: RestoreState);
}
Expand description

Trait for single-core locks.

Required Methods§

Source

unsafe fn enter(&self) -> RestoreState

Acquires the raw lock

§Safety

The returned tokens must be released in reverse order, on the same thread that they were created on.

Source

unsafe fn exit(&self, token: RestoreState)

Releases the raw lock

§Safety
  • The token must be created by self.enter()
  • Tokens must be released in reverse order to their creation, on the same thread that they were created on.

Implementors§