Skip to content

Commit 699325c

Browse files
committed
Add test for Amanieu#203
1 parent 761a4d5 commit 699325c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/issue_203.rs

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

0 commit comments

Comments
 (0)