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