diff options
Diffstat (limited to 'src/libstd/thread_local/mod.rs')
| -rw-r--r-- | src/libstd/thread_local/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index 4d47703d30f..e7c4e4ccdfb 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -86,7 +86,7 @@ pub mod __impl { /// assert_eq!(*f.borrow(), 1); /// *f.borrow_mut() = 3; /// }); -/// }).detach(); +/// }); /// /// // we retain our original value of 2 despite the child thread /// FOO.with(|f| { @@ -580,7 +580,7 @@ mod tests { } thread_local!(static FOO: Foo = foo()); - Thread::spawn(|| { + Thread::scoped(|| { assert!(FOO.state() == State::Uninitialized); FOO.with(|_| { assert!(FOO.state() == State::Valid); @@ -644,7 +644,7 @@ mod tests { } } - Thread::spawn(move|| { + Thread::scoped(move|| { drop(S1); }).join().ok().unwrap(); } @@ -662,7 +662,7 @@ mod tests { } } - Thread::spawn(move|| unsafe { + Thread::scoped(move|| unsafe { K1.with(|s| *s.get() = Some(S1)); }).join().ok().unwrap(); } |
