diff options
| author | bors <bors@rust-lang.org> | 2015-01-07 05:31:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-07 05:31:23 +0000 |
| commit | 9e4e524e0eb17c8f463e731f23b544003e8709c6 (patch) | |
| tree | 916024d35e08f0826c20654f629ec596b5cb1f14 /src/libstd/thread_local | |
| parent | ea6f65c5f1a3f84e010d2cef02a0160804e9567a (diff) | |
| parent | a64000820f0fc32be4d7535a9a92418a434fa4ba (diff) | |
| download | rust-9e4e524e0eb17c8f463e731f23b544003e8709c6.tar.gz rust-9e4e524e0eb17c8f463e731f23b544003e8709c6.zip | |
auto merge of #20677 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/thread_local')
| -rw-r--r-- | src/libstd/thread_local/mod.rs | 15 | ||||
| -rw-r--r-- | src/libstd/thread_local/scoped.rs | 8 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs index e0cbaa8ca50..e7c4e4ccdfb 100644 --- a/src/libstd/thread_local/mod.rs +++ b/src/libstd/thread_local/mod.rs @@ -40,8 +40,7 @@ use prelude::v1::*; use cell::UnsafeCell; -#[cfg_attr(stage0, macro_escape)] -#[cfg_attr(not(stage0), macro_use)] +#[macro_use] pub mod scoped; // Sure wish we had macro hygiene, no? @@ -87,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| { @@ -346,7 +345,7 @@ mod imp { pub dtor_running: UnsafeCell<bool>, // should be Cell } - unsafe impl<T> ::kinds::Sync for Key<T> { } + unsafe impl<T> ::marker::Sync for Key<T> { } #[doc(hidden)] impl<T> Key<T> { @@ -472,7 +471,7 @@ mod imp { pub os: OsStaticKey, } - unsafe impl<T> ::kinds::Sync for Key<T> { } + unsafe impl<T> ::marker::Sync for Key<T> { } struct Value<T: 'static> { key: &'static Key<T>, @@ -581,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); @@ -645,7 +644,7 @@ mod tests { } } - Thread::spawn(move|| { + Thread::scoped(move|| { drop(S1); }).join().ok().unwrap(); } @@ -663,7 +662,7 @@ mod tests { } } - Thread::spawn(move|| unsafe { + Thread::scoped(move|| unsafe { K1.with(|s| *s.get() = Some(S1)); }).join().ok().unwrap(); } diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index 714b71d5dbd..1fb5652bc0c 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -108,7 +108,7 @@ macro_rules! __scoped_thread_local_inner { const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::thread_local::scoped::__impl::OS_INIT, - marker: ::std::kinds::marker::InvariantType, + marker: ::std::marker::InvariantType, } }; @@ -211,7 +211,7 @@ mod imp { #[doc(hidden)] pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> } - unsafe impl<T> ::kinds::Sync for KeyInner<T> { } + unsafe impl<T> ::marker::Sync for KeyInner<T> { } #[doc(hidden)] impl<T> KeyInner<T> { @@ -224,7 +224,7 @@ mod imp { #[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))] mod imp { - use kinds::marker; + use marker; use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] @@ -233,7 +233,7 @@ mod imp { pub marker: marker::InvariantType<T>, } - unsafe impl<T> ::kinds::Sync for KeyInner<T> { } + unsafe impl<T> ::marker::Sync for KeyInner<T> { } #[doc(hidden)] impl<T> KeyInner<T> { |
