macro_rules! tls_get { ($var:ident) => { ... }; }
Expand description
Get the value of a thread local storage variable.
// from examples/tetris.rs:
tls_init!(screen_buffer, String, "".to_string());
eprint!("{}", tls_get!(screen_buffer));
tls_init!(use_color, bool, true); // true if we use color, false if not
if tls_get!(use_color) {
// ...
}