1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
//! Safe atomic boxes.
//!
//! The standard library provides atomic booleans, integers, and pointers.
//! `AtomicPtr` is safe for loading, storing, and so forth; but pointers are
//! unsafe to use.
//!
//! It turns out that a safe atomic `Box` type is possible. Unfortunately, the
//! only operation it supports is `swap`. Still, this is sufficient for some
//! lock-free data structures, so here it is!

#![cfg_attr(not(test), no_std)]

extern crate alloc;

mod atomic_box;
mod atomic_option_box;

pub use atomic_box::AtomicBox;
pub use atomic_option_box::AtomicOptionBox;