source: CIVL/examples/contracts/with.cvl@ 8b2639d

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 8b2639d was 15a2fae, checked in by Manchun Zheng <zmanchun@…>, 10 years ago

fixed a bug in the implementation of $with

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

  • Property mode set to 100644
File size: 399 bytes
RevLine 
[13b3e46]1#include<collate.cvh>
2
[15a2fae]3$input int N=2;
[13b3e46]4
[15a2fae]5$gcollator gcollator=$gcollator_create($here, N);
6
7void process(int id){
8 $collator collator=$collator_create(gcollator, $here, id);
[05fdac6]9 $collate_state cs=$collate_arrives(collator, $here);
[15a2fae]10
[a55a02c]11 $with (cs) {
[13b3e46]12 $assert($true);
13 }
[a55a02c]14 $collate_departs(collator);
[13b3e46]15 $free(collator);
[15a2fae]16}
17
18
19int main(){
20 $parfor(int i: 0 .. N-1)
21 process(i);
[13b3e46]22 $free(gcollator);
23}
Note: See TracBrowser for help on using the repository browser.