source: CIVL/examples/backend/atomicExample.c@ 682e8bb

1.23 2.0 main test-branch
Last change on this file since 682e8bb was a552cec, checked in by Manchun Zheng <zmanchun@…>, 10 years ago

cleaned up examples

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

  • Property mode set to 100644
File size: 263 bytes
Line 
1$input int x;
2int s=0;
3
4void foo(){
5 $when(s>0);
6 $atomic{
7 s--;
8 }
9}
10
11void goo(){
12 $atomic{
13 s=1;
14 $when(x>0)
15 s*=2;
16 }
17}
18
19int main(){
20 $proc fp, gp;
21
22 $atomic{
23 fp = $spawn foo();
24 gp = $spawn goo();
25 }
26 $wait(fp);
27 $wait(gp);
28}
Note: See TracBrowser for help on using the repository browser.