source:
CIVL/examples/fairness/fair3.cvl
| Last change on this file was 1cface7, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 256 bytes | |
| Line | |
|---|---|
| 1 | /* This program has a non-terminating fair execution */ |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | int x=0, y=0; |
| 5 | |
| 6 | void f() { |
| 7 | $when (x==1) y=1; |
| 8 | printf("bye\n"); |
| 9 | } |
| 10 | |
| 11 | int main() { |
| 12 | $proc p1 = $spawn f(); |
| 13 | while (y==0) { |
| 14 | x=0; |
| 15 | x=1; |
| 16 | printf("hi\n"); |
| 17 | } |
| 18 | $wait(p1); |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
