]> git.proxmox.com Git - rustc.git/blame - vendor/parking_lot/tests/issue_203.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / vendor / parking_lot / tests / issue_203.rs
CommitLineData
ba9703b0
XL
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}