Skip to content

Commit

Permalink
Add incr_twice.imp
Browse files Browse the repository at this point in the history
  • Loading branch information
0npv527yh9 committed Jan 30, 2024
1 parent 9491572 commit dc1da24
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/concurrency/flow/negative/not-supported/incr_twice.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
let a = mkref 2 in
let l = newlock() in
let t = fork({
acq(l);
a := *a + 1;
rel(l);
}) in {
acq(l);
a := *a + 1;
rel(l);
wait(t);
freelock(l);
assert(*a = 4);
}
}

0 comments on commit dc1da24

Please sign in to comment.