source:
CIVL/examples/por/atomic0.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 155 bytes | |
| Rev | Line | |
|---|---|---|
| [e6b02c8] | 1 | #include<civlc.cvh> |
| 2 | ||
| [b15374a] | 3 | int x=0; |
| [e6b02c8] | 4 | |
| [b15374a] | 5 | void f() { |
| 6 | x=1; | |
| 7 | } | |
| [e6b02c8] | 8 | |
| [b15374a] | 9 | void main() { |
| [48bfab9] | 10 | $proc fp = $spawn f(); |
| 11 | ||
| [b15374a] | 12 | $atomic { |
| [3ff27cf] | 13 | $assert((x==0)); // false |
| [b15374a] | 14 | } |
| [48bfab9] | 15 | $wait(fp); |
| [b15374a] | 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
