pub struct PhaserCriticalSection { /* private fields */ }
Expand description

Guard struct that represents a “writer critical section” for a WriterReaderPhaser.

PhaserCriticalSection is a scope-based guard to signal the beginning and end of a “writer critical section” to the phaser. Upon calling writer_critical_section, the phaser atomically increments a counter, and when the returned PhaserCriticalSection drops, the drop call atomically increments another counter. On platforms with atomic increment instructions, this should result in wait-free synchronization.

Example

{
    let _guard = phaser.writer_critical_section();
    // perform writes
} // _guard drops, signaling the end of the section

Trait Implementations

Upon drop, a PhaserCriticalSection will signal its parent WriterReaderPhaser that the critical section has ended.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.