pub unsafe trait SharedRawMutex {
// Required methods
fn share(&self) -> Self;
fn lock<R>(&self, f: impl FnOnce() -> R) -> R;
}Expand description
A handle to the lock that guards the driver’s hardware access.
The driver passes the lock to several parts, so it takes a handle that it can duplicate. Every
handle that share returns locks the same lock.
Handles are passed to other contexts only as their Send and Sync implementations allow.
§Safety
sharereturns a handle that locks the same lock asself.- While
lockrunsf, no other context can runlockon a handle to the same lock.
Required Methods§
Returns another handle to the same lock.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".