source: CIVL/examples/locks.cvl@ cffd3a6

1.23 2.0 main test-branch
Last change on this file since cffd3a6 was b6565a0, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Added some tests. Expanded pointers.cvl. Changed \ to $ in locks.cvl.

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

  • Property mode set to 100644
File size: 368 bytes
Line 
1#include<civlc.h>
2
3int x;
4int y;
5
6void f(int n) {
7 for (int i=0; i<n; i++) {
8 $when (x==0) x=1;
9 $when (y==0) y=1;
10 y=0;
11 x=0;
12 }
13}
14
15void g(int m) {
16 for (int i=0; i<m; i++) {
17 $when (y==0) y=1;
18 $when (x==0) x=1;
19 x=0;
20 y=0;
21 }
22}
23
24void main() {
25 x = 0;
26 y = 0;
27 $proc p = $spawn f(10);
28 $proc q = $spawn g(10);
29 $wait p;
30 $wait q;
31}
Note: See TracBrowser for help on using the repository browser.