source:
CIVL/mods/dev.civl.com/examples/por/loop2.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 227 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.cvh> |
| 2 | |
| 3 | int x; |
| 4 | |
| 5 | void thread(){ |
| 6 | while(x<5) |
| 7 | x++; |
| 8 | } |
| 9 | |
| 10 | int main(){ |
| 11 | $proc ps[2]; |
| 12 | |
| 13 | for(int i=0; i<2; i++) |
| 14 | ps[i]=$spawn thread(); |
| 15 | if(x<5){ |
| 16 | Loop: goto Loop; |
| 17 | } |
| 18 | $assert(x==5||x==6); |
| 19 | $waitall(ps, 2); |
| 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
