Skip to main content

RawRwLockDowngrade

Trait RawRwLockDowngrade 

Source
pub unsafe trait RawRwLockDowngrade: RawRwLock {
    // Required method
    unsafe fn downgrade(&self, guard: Self::ExclusiveGuard) -> Self::SharedGuard;
}
Expand description

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

§Safety

Implementations must uphold the safety requirements of RawRwLock for the additional methods provided by this trait. Downgrading from exclusive access must release to subsequent lock acquisitions.

Required Methods§

Source

unsafe fn downgrade(&self, guard: Self::ExclusiveGuard) -> Self::SharedGuard

Atomically downgrades an exclusive lock into a shared lock without allowing any thread to take an exclusive lock in the meantime.

§Safety

This method requires the state for an exclusive acquisition of this lock held in the current context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§