Module rtic_sync::arbiter

source ·
Expand description

A Mutex-like FIFO with unlimited-waiter for embedded systems.

Example usage:

use rtic_sync::arbiter::Arbiter;

// Instantiate an Arbiter with a static lifetime.
static ARBITER: Arbiter<u32> = Arbiter::new(32);

async fn run(){
    let write_42 = async move {
        *ARBITER.access().await = 42;
    };

    let write_1337 = async move {
        *ARBITER.access().await = 1337;
    };

    // Attempt to access the Arbiter concurrently.
    select(write_42, write_1337).await;
}

Modules§

Structs§

  • An FIFO waitqueue for use in shared bus usecases.
  • This token represents exclusive access to the value protected by the Arbiter.