# [−][src]Trait lock_api::RawMutexFair

    pub unsafe trait RawMutexFair: RawMutex {
        fn unlock_fair(&self);

        fn bump(&self) { ... }
    }

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

### `fn unlock_fair(&self)`

Unlocks this mutex using a fair unlock protocol.

Loading content...

## Provided methods

### `fn bump(&self)`

Temporarily yields the mutex to a waiting thread if there is one.

This method is functionally equivalent to calling `unlock_fair` followed by `lock`, however it can be much more efficient in the case where there are no waiting threads.

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)