Skip to main content

RawCondvar

Trait RawCondvar 

Source
pub unsafe trait RawCondvar {
    type RawMutex: RawMutex;

    const INIT: Self;

    // Required methods
    unsafe fn wait(&self, mutex: &Self::RawMutex);
    fn notify_one(&self) -> bool;
    fn notify_all(&self) -> usize;
}
Expand description

Provides the inner implementation for a Condvar over a particular type of RawMutex.

§Safety

Implementions must ensure that wait is safe to call, regardless of the specific RawMutex instance provided. If an implementation only supports one instance at a time, wait may panic.

Required Associated Constants§

Source

const INIT: Self

Initial value for a new condvar.

Required Associated Types§

Source

type RawMutex: RawMutex

The type of RawMutex this condvar can work with.

Required Methods§

Source

unsafe fn wait(&self, mutex: &Self::RawMutex)

Wait until the provided RawMutex is available.

§Safety

Caller must ensure the provided mutex is locked, and that they are the owner of said lock for the duration of this call.

§Panics

Implementations are permitted to panic if requested to wait on two distinct RawMutexs simultaneously.

Source

fn notify_one(&self) -> bool

Notify a single waiting thread.

Source

fn notify_all(&self) -> usize

Notify all waiting threads.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§