source:
CIVL/examples/pthread/test.cvl@
325d439
| Last change on this file since 325d439 was 38374b7, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 326 bytes | |
| Line | |
|---|---|
| 1 | #include <civlc.h> |
| 2 | #include <stdio.h> |
| 3 | #include <assert.h> |
| 4 | |
| 5 | |
| 6 | |
| 7 | void *t1() |
| 8 | { |
| 9 | while(1){ |
| 10 | printf("stuff"); |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | int main(void) |
| 15 | { |
| 16 | $proc id1, id2; |
| 17 | |
| 18 | id1 = $spawn t1(); |
| 19 | id2 = $spawn t1(); |
| 20 | if($proc_defined(id1) && $proc_defined(id2)) { |
| 21 | if(id1 == id2){ |
| 22 | printf("blah"); |
| 23 | } |
| 24 | } |
| 25 | $wait(id1); |
| 26 | $wait(id2); |
| 27 | } |
Note:
See TracBrowser
for help on using the repository browser.
