source: CIVL/examples/concurrency/locksBad.cvl@ 4f22a92

1.23 2.0 main test-branch
Last change on this file since 4f22a92 was 20d2740, checked in by Stephen Siegel <siegel@…>, 13 years ago

Worked with Tim to get first message-passing example up. Cleaned up concurrency tests somewhat.

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

  • Property mode set to 100644
File size: 324 bytes
Line 
1
2_Bool lock0 = 0;
3_Bool lock1 = 0;
4
5void proc0() {
6 while (1) {
7 $when (!lock0) lock0=1;
8 $when (!lock1) lock1=1;
9 lock0=0;
10 lock1=0;
11 }
12}
13
14void proc1() {
15 while (1) {
16 $when (!lock1) lock1=1;
17 $when (!lock0) lock0=1;
18 lock0=0;
19 lock1=0;
20 }
21}
22
23void main() {
24 $spawn proc0();
25 $spawn proc1();
26}
Note: See TracBrowser for help on using the repository browser.