source:
CIVL/examples/por/loop.cvl@
227bd05
| Last change on this file since 227bd05 was fc15297, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 329 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.cvh> |
| 2 | |
| 3 | int g=0; |
| 4 | |
| 5 | void proc0(){ |
| 6 | int x,y,z; |
| 7 | |
| 8 | while(1){ |
| 9 | x=0; |
| 10 | y=0; |
| 11 | z=0; |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | void proc1(){ |
| 16 | g=1; |
| 17 | } |
| 18 | |
| 19 | void proc2(){ |
| 20 | g=2; |
| 21 | } |
| 22 | |
| 23 | int main(){ |
| 24 | $proc p0, p1, p2; |
| 25 | |
| 26 | $atomic{ |
| 27 | p0=$spawn proc0(); |
| 28 | p1=$spawn proc1(); |
| 29 | p2=$spawn proc2(); |
| 30 | } |
| 31 | $wait(p0); |
| 32 | $wait(p1); |
| 33 | $wait(p2); |
| 34 | $assert(g>0); |
| 35 | } |
Note:
See TracBrowser
for help on using the repository browser.
