1use parking_lot::RwLock;
2use std::thread;
3
4struct Bar(RwLock<()>);
5
6impl Drop for Bar {
7 fn drop(&mut self) {
8 let _n = self.0.write();
9 }
10}
11
12thread_local! {
13 static B: Bar = Bar(RwLock::new(()));
14}
15
16#[test]
17fn main() {
18 thread::spawn(|| {
19 B.with(|_| ());
20
21 let a = RwLock::new(());
22 let _a = a.read();
23 })
24 .join()
25 .unwrap();
26}
27