1#[cfg(all(loom, test))]
2macro_rules! tokio_thread_local {
3 ($(#[$attrs:meta])* $vis:vis static $name:ident: $ty:ty = const { $expr:expr } $(;)?) => {
4 loom::thread_local! {
5 $(#[$attrs])*
6 $vis static $name: $ty = $expr;
7 }
8 };
9
10 ($($tts:tt)+) => { loom::thread_local!{ $($tts)+ } }
11}
12
13#[cfg(not(tokio_no_const_thread_local))]
14#[cfg(not(all(loom, test)))]
15macro_rules! tokio_thread_local {
16 ($($tts:tt)+) => {
17 ::std::thread_local!{ $($tts)+ }
18 }
19}
20
21#[cfg(tokio_no_const_thread_local)]
22#[cfg(not(all(loom, test)))]
23macro_rules! tokio_thread_local {
24 ($(#[$attrs:meta])* $vis:vis static $name:ident: $ty:ty = const { $expr:expr } $(;)?) => {
25 ::std::thread_local! {
26 $(#[$attrs])*
27 $vis static $name: $ty = $expr;
28 }
29 };
30
31 ($($tts:tt)+) => { ::std::thread_local!{ $($tts)+ } }
32}
33