source: CIVL/examples/por/loop.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 389 bytes
Line 
1#include<civlc.cvh>
2
3int g=0;
4
5void proc0(){
6 int x,y,z;
7
8 $atomic{
9 while(1){
10 x=0;
11 y=0;
12 z=0;
13 }
14 }
15}
16
17void proc1(){
18 g=1;
19 $assert(g==1);
20}
21
22void proc2(){
23 g=2;
24 $assert(g==2);
25}
26
27int main(){
28 $proc p0, p1, p2;
29
30 $atomic{
31 p0=$spawn proc0();
32 p1=$spawn proc1();
33 p2=$spawn proc2();
34 }
35 $wait(p1);
36 $wait(p2);
37 $assert(g==0);
38 $wait(p0);
39}
Note: See TracBrowser for help on using the repository browser.