Skip to content

Commit

Permalink
Fix doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
colinjfw committed Jan 7, 2024
1 parent 274dccd commit e00580c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ It's common to wrap [`AtomicArc`] in an [`Arc`] itself to allow sharing across
threads.

```
# use std::sync::Arc;
# use std::thread;
# use atomic_arc::AtomicArc;
let arc = Arc::new(AtomicArc::new(Arc::new(1)));
let handle = arc.clone();
thread::spawn(move || {
let val = *handle.load();
println!("{val}"); // may print '1' or '2'
Expand Down

0 comments on commit e00580c

Please sign in to comment.