#atomic #order #wrapper #sync #no-alloc

no-std relaxed

Wrappers around Atomics that always use Ordering::Relaxed

2 releases

0.1.1 Sep 13, 2024
0.1.0 Sep 9, 2024

#283 in Concurrency

Download history 246/week @ 2024-09-08 75/week @ 2024-09-15 26/week @ 2024-09-22 33/week @ 2024-09-29

380 downloads per month

MIT/Apache

8KB
79 lines

relaxed

github Crates.io docs.rs

Wrappers around Atomics that always use Ordering::Relaxed

// instead of:
use std::sync::atomic::{AtomicBool, Ordering};
let atomic = AtomicBool::new(false);
atomic.store(true, Ordering::Relaxed);
assert_eq!(atomic.load(Ordering::Relaxed), true);

// you can do:
use relaxed::RelaxedBool;
let atomic = RelaxedBool::new(false);
atomic.set(true);
assert_eq!(atomic.get(), true);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~225KB