source: CIVL/examples/languageFeatures/atomicFunctionSpecifier.cvl@ 44512b7

1.23 2.0 main test-branch
Last change on this file since 44512b7 was a8a3f22, checked in by Manchun Zheng <zmanchun@…>, 10 years ago

added the translation of ACSL AST nodes into CIVL model; added the support of $atomic_f function

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2926 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 184 bytes
RevLine 
[a8a3f22]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
11int data=0;
12
13void main(){
14 $parfor(int i: 0 .. 1)
15 increase(&data);
16}
Note: See TracBrowser for help on using the repository browser.