hazard3-sync 0.3.0

no-std, no-alloc synchronization primitives with async support
Documentation

hazard3-sync

Published replacement: hazard3-sync replaces the formerly published embassy-sync-riscv. See the project repository for the publication status of the Hazard3 packages. Upstream license and attribution notices are retained.

Crates.io docs.rs License: MIT OR Apache-2.0

Fork of Embassy for RISC-V. hazard3-sync is an independent, fork of embassy-sync taken from the Embassy main branch, maintained by Jorge Andre Castro at https://github.com/jorgeandrecastro/Hazard3. It was originally republished under another name because hazard3-rp needs the unreleased changes of main, and crates.io does not accept git dependencies. Add hazard3-sync directly in Cargo.toml and import it as hazard3_sync. Use the hazard3-* versions of the forked crates together (hazard3-time, hazard3-executor, hazard3-sync, ...) to avoid duplicate/incompatible copies in your build.

An Embassy project.

Synchronization primitives and data structures with async support:

  • Channel - A Multiple Producer Multiple Consumer (MPMC) channel. Each message is only received by a single consumer.
  • PriorityChannel - A Multiple Producer Multiple Consumer (MPMC) channel. Each message is only received by a single consumer. Higher priority items are shifted to the front of the channel.
  • PubSubChannel - A broadcast channel (publish-subscribe) channel. Each message is received by all consumers.
  • Signal - Signalling latest value to a single consumer.
  • Watch - Signalling latest value to multiple consumers.
  • Mutex - Mutex for synchronizing state between asynchronous tasks.
  • Pipe - Byte stream implementing embedded_io traits.
  • WakerRegistration - Utility to register and wake a Waker.
  • AtomicWaker - Utility to register and wake a Waker from interrupt context.
  • MultiWakerRegistration - Utility registering and waking multiple Waker's.
  • LazyLock - A value which is initialized on the first access

Migration to 0.3.0

The Rust library is now hazard3_sync instead of embassy_sync. Update imports and macro paths; this is a source-breaking change. Add the package directly without a package alias:

[dependencies]
hazard3-sync = "0.3"

Use compatible versions of the other Hazard3 crates together; older releases may use different library names.

Interoperability

Futures from this crate can run on any executor.

Acknowledgements

This crate is a derivative work of the Embassy project (embassy-rs/embassy), Copyright (c) Embassy project contributors, used under the MIT OR Apache-2.0 licenses. The original copyright and license notices are kept (see LICENSE-MIT and LICENSE-APACHE). Embassy and its authors are not affiliated with, and do not endorse, this fork. Thank you to the Embassy team and contributors for their work.