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§
Sourceunsafe fn enter(&self) -> RestoreState
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.
Sourceunsafe fn exit(&self, token: RestoreState)
unsafe fn exit(&self, token: RestoreState)
Releases the raw lock
§Safety
- The
tokenmust be created byself.enter() - Tokens must be released in reverse order to their creation, on the same thread that they were created on.