source:
CIVL/examples/languageFeatures/atomicStatement.cvl@
69193a9
| Last change on this file since 69193a9 was 10e8759, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 217 bytes | |
| Rev | Line | |
|---|---|---|
| [d410676] | 1 | int n = 3; |
| [9705dfd] | 2 | |
| 3 | void main(){ | |
| [d410676] | 4 | int x = 3; |
| [9705dfd] | 5 | |
| [10e8759] | 6 | // non-determinism allowed in $atomic block |
| [9705dfd] | 7 | $atomic{ |
| [10e8759] | 8 | $choose { |
| 9 | $when (n>2) { x=2; } | |
| 10 | $when (n>1) { x=1; } | |
| 11 | default: {x=0; } | |
| [9705dfd] | 12 | } |
| 13 | } | |
| 14 | ||
| [10e8759] | 15 | $assert (x == 2 || x == 1); |
| [9705dfd] | 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
