relaxed

Crates.iorelaxed
lib.rsrelaxed
version0.1.1
sourcesrc
created_at2024-09-09 14:40:33.295381
updated_at2024-09-13 19:18:23.594801
descriptionWrappers around Atomics that always use `Ordering::Relaxed`
homepage
repositoryhttps://github.com/dimpolo/relaxed/
max_upload_size
id1369389
size20,110
(dimpolo)

documentation

README

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.
Commit count: 0

cargo fmt