source:
CIVL/examples/languageFeatures/atomicFunctionSpecifier.cvl@
ca6241a
| Last change on this file since ca6241a was a8a3f22, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 184 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.cvh> |
| 2 | |
| 3 | $atomic_f void increase(int* p){ |
| 4 | int old=*p; |
| 5 | |
| 6 | *p=(*p)+1; |
| 7 | |
| 8 | $assert(old+1==*p); |
| 9 | } |
| 10 | |
| 11 | int data=0; |
| 12 | |
| 13 | void main(){ |
| 14 | $parfor(int i: 0 .. 1) |
| 15 | increase(&data); |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
