We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b1650e commit b8e87d3Copy full SHA for b8e87d3
tests/many-seeds/reentrant-lock.rs
@@ -0,0 +1,19 @@
1
+#![feature(reentrant_lock)]
2
+//! This is a regression test for
3
+//! <https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/reentrant.20lock.20failure.20on.20musl>.
4
+
5
+use std::cell::Cell;
6
+use std::sync::ReentrantLock;
7
+use std::thread;
8
9
+static LOCK: ReentrantLock<Cell<i32>> = ReentrantLock::new(Cell::new(0));
10
11
+fn main() {
12
+ for _ in 0..20 {
13
+ thread::spawn(move || {
14
+ let val = LOCK.lock();
15
+ val.set(val.get() + 1);
16
+ drop(val);
17
+ });
18
+ }
19
+}
0 commit comments