Skip to content

Commit

Permalink
Add test for #203
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Apr 10, 2020
1 parent 761a4d5 commit 699325c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/issue_203.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use parking_lot::RwLock;
use std::thread;

struct Bar(RwLock<()>);

impl Drop for Bar {
fn drop(&mut self) {
let _n = self.0.write();
}
}

thread_local! {
static B: Bar = Bar(RwLock::new(()));
}

#[test]
fn main() {
thread::spawn(|| {
B.with(|_| ());

let a = RwLock::new(());
let _a = a.read();
})
.join()
.unwrap();
}

0 comments on commit 699325c

Please sign in to comment.