1
0
Fork 0
firefox/third_party/rust/parking_lot/tests/issue_203.rs
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

26 lines
380 B
Rust

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();
}