source: CIVL/examples/contracts/update.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: 685 bytes
Line 
1#include<collate.cvh>
2
3$gcollator gcollator=$gcollator_create($here, 2);
4_Bool start=$false;//, done=$false;
5
6void proc1(){
7 $collator collator=$collator_create(gcollator, $here, 0);
8
9 $collate_state cs=$collate_arrives(collator, $here);
10 start=$true;
11 $collate_departs(collator, cs);
12 $free(collator);
13}
14
15void proc2(){
16 $collator collator=$collator_create(gcollator, $here, 1);
17 $collate_state cs;
18
19 $when(start);
20 $update(collator) $pow(5, 6);
21 cs = $collate_arrives(collator, $here);
22 $collate_departs(collator, cs);
23 $free(collator);
24}
25
26int main(){
27 $proc p[2];
28
29 $atomic{
30 p[0]=$spawn proc1();
31 p[1]=$spawn proc2();
32 }
33 $waitall(p, 2);
34 $free(gcollator);
35}
Note: See TracBrowser for help on using the repository browser.