2 releases
0.1.1 | Sep 13, 2024 |
---|---|
0.1.0 | Sep 9, 2024 |
#373 in Concurrency
44 downloads per month
8KB
79 lines
relaxed
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
~230KB