Trait lock_api::RawMutexFair
source · pub unsafe trait RawMutexFair: RawMutex {
fn unlock_fair(&self);
fn bump(&self) { ... }
}
Expand description
Additional methods for mutexes which support fair unlocking.
Fair unlocking means that a lock is handed directly over to the next waiting thread if there is one, without giving other threads the opportunity to “steal” the lock in the meantime. This is typically slower than unfair unlocking, but may be necessary in certain circumstances.
Required Methods§
sourcefn unlock_fair(&self)
fn unlock_fair(&self)
Unlocks this mutex using a fair unlock protocol.