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

    pub unsafe trait RawRwLockUpgrade: RawRwLock {
        fn lock_upgradable(&self);
        fn try_lock_upgradable(&self) -> bool;
        fn unlock_upgradable(&self);
        fn upgrade(&self);
        fn try_upgrade(&self) -> bool;
    }

Additional methods for RwLocks which support atomically upgrading a shared lock to an exclusive lock.

This requires acquiring a special "upgradable read lock" instead of a normal shared lock. There may only be one upgradable lock at any time, otherwise deadlocks could occur when upgrading.

## Required methods

### `fn lock_upgradable(&self)`

Acquires an upgradable lock, blocking the current thread until it is able to do so.

### `fn try_lock_upgradable(&self) -> bool`

Attempts to acquire an upgradable lock without blocking.

### `fn unlock_upgradable(&self)`

Releases an upgradable lock.

### `fn upgrade(&self)`

Upgrades an upgradable lock to an exclusive lock.

### `fn try_upgrade(&self) -> bool`

Attempts to upgrade an upgradable lock to an exclusive lock without blocking.

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`)