source: CIVL/examples/concurrency/locksBad.cvl@ 50f834b

1.23 2.0 main test-branch
Last change on this file since 50f834b was 48bfab9, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

added checking for memory leak when collecting a dyscope and for process leak when the main process returns; fixed all test cases accordingly; added a filesystem_destroy call for IOTransformer to get rid of memory leak.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@912 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 436 bytes
Line 
1/* Commandline execution:
2 * civl verify locksBad.cvl
3 * */
4_Bool lock0 = 0;
5_Bool lock1 = 0;
6
7void proc0() {
8 while (1) {
9 $when (!lock0) lock0=1;
10 $when (!lock1) lock1=1;
11 lock0=0;
12 lock1=0;
13 }
14}
15
16void proc1() {
17 while (1) {
18 $when (!lock1) lock1=1;
19 $when (!lock0) lock0=1;
20 lock0=0;
21 lock1=0;
22 }
23}
24
25void main() {
26 $proc p0 = $spawn proc0();
27 $proc p1 = $spawn proc1();
28
29 $wait(p0);
30 $wait(p1);
31}
Note: See TracBrowser for help on using the repository browser.