Struct synchronoise::PhaserCriticalSection [] [src]

pub struct PhaserCriticalSection { /* fields omitted */ }

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

impl Drop for PhaserCriticalSection
[src]

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

A method called when the value goes out of scope. Read more