Open quininer opened 4 years ago
loom::lazy_static!{ static ref ID: usize = 0x42; } loom::thread_local!{ static BAR: Bar = Bar; } struct Bar; impl Drop for Bar { fn drop(&mut self) { let _ = &*ID; } } fn main() { loom::model(|| { BAR.with(|_| ()); }); }
output:
thread 'main' panicked at 'attempted to access lazy_static during shutdown', /loom-0.3.4/src/rt/lazy_static.rs:43:9
Maybe we should be ensured that drop of lazy_static! occurs after thread_local!.
lazy_static!
thread_local!
output:
Maybe we should be ensured that drop of
lazy_static!
occurs afterthread_local!
.