Restructure and rename thread local things in std.
This commit is contained in:
@@ -153,23 +153,23 @@ macro_rules! thread_local {
|
||||
() => {};
|
||||
|
||||
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => (
|
||||
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
|
||||
$crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
|
||||
$crate::thread_local!($($rest)*);
|
||||
);
|
||||
|
||||
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }) => (
|
||||
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
|
||||
$crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
|
||||
);
|
||||
|
||||
// process multiple declarations
|
||||
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => (
|
||||
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
|
||||
$crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
|
||||
$crate::thread_local!($($rest)*);
|
||||
);
|
||||
|
||||
// handle a single declaration
|
||||
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => (
|
||||
$crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
|
||||
$crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, $init);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -204,9 +204,12 @@ pub use self::local::{AccessError, LocalKey};
|
||||
// by the elf linker. "static" is for single-threaded platforms where a global
|
||||
// static is sufficient.
|
||||
|
||||
// Implementation details used by the thread_local!{} macro.
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "libstd_thread_internals", issue = "none")]
|
||||
pub use crate::sys::common::thread_local::Key as __LocalKeyInner;
|
||||
#[unstable(feature = "thread_local_internals", issue = "none")]
|
||||
pub mod local_impl {
|
||||
pub use crate::sys::common::thread_local::{thread_local_inner, Key};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Builder
|
||||
|
||||
Reference in New Issue
Block a user