Expand description
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!
Structsยง
- Atomic
Box - A type that holds a single
Box<T>value and can be safely shared between threads. - Atomic
Option Box - A type that holds a single
Option<Box<T>>value and can be safely shared between threads.