Skip to main content

Module sync

Module sync 

Source
Expand description

Platform-specific synchronization primitives

This module provides cross-platform abstractions for synchronization primitives that work on both native (tokio) and WASM targets.

On native targets, we use tokio’s async synchronization primitives. On WASM, we use std::sync primitives (which work because WASM is single-threaded) and futures::channel for message passing.

Modules§

mpsc
A multi-producer, single-consumer queue for sending values between asynchronous tasks.

Macros§

mutex_lock
Helper macro for acquiring a mutex lock.
read_lock
Helper macro for acquiring a read lock.
write_lock
Helper macro for acquiring a write lock.

Structs§

Mutex
An asynchronous Mutex-like type.
RwLock
An asynchronous reader-writer lock.