Skip to main content

Module sync

Module sync 

Source

Structs§

TaskCounter
Tracks the number of active background tasks. reset() cancels the token then calls wait_for_zero() to ensure all tasks have exited before clearing shared state.
TaskCounterPause
RAII admission pause used by reset. Dropping it reopens the coordinator even when reset returns early with an error.
TaskGuard
RAII guard that decrements the TaskCounter when dropped. Move this into each spawned task to track its lifetime.

Functions§

check_or_receiver
Returns Ok(()) if the value already exists, or spawns a task that waits for it (or cancellation). The spawned task returns true if the value arrived and false if cancelled.
get_or_receiver
get_value