Skip to content

Commit 39d6d7e

Browse files
authored
use std::thread::scope instead of crossbeam_utils::thread in doc
1 parent 291c0b6 commit 39d6d7e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,15 @@
100100
//! use std::sync::Arc;
101101
//!
102102
//! use arc_swap::ArcSwap;
103-
//! use crossbeam_utils::thread;
104103
//!
105104
//! let config = ArcSwap::from(Arc::new(String::default()));
106-
//! thread::scope(|scope| {
107-
//! scope.spawn(|_| {
105+
//! std::thread::scope(|scope| {
106+
//! scope.spawn(|| {
108107
//! let new_conf = Arc::new("New configuration".to_owned());
109108
//! config.store(new_conf);
110109
//! });
111110
//! for _ in 0..10 {
112-
//! scope.spawn(|_| {
111+
//! scope.spawn(|| {
113112
//! loop {
114113
//! let cfg = config.load();
115114
//! if !cfg.is_empty() {
@@ -119,7 +118,7 @@
119118
//! }
120119
//! });
121120
//! }
122-
//! }).unwrap();
121+
//! });
123122
//! ```
124123
//!
125124
//! [RwLock]: https://doc.rust-lang.org/std/sync/struct.RwLock.html

0 commit comments

Comments
 (0)