source: CIVL/examples/languageFeatures/atomicStatement.cvl@ 69193a9

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 69193a9 was 10e8759, checked in by Manchun Zheng <zmanchun@…>, 13 years ago

Implement $atomic and $atom blocks. Tests are added accordingly. TODO: implement related methods in TransientProcessState.java.

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

  • Property mode set to 100644
File size: 217 bytes
Line 
1int n = 3;
2
3void main(){
4 int x = 3;
5
6 // non-determinism allowed in $atomic block
7 $atomic{
8 $choose {
9 $when (n>2) { x=2; }
10 $when (n>1) { x=1; }
11 default: {x=0; }
12 }
13 }
14
15 $assert (x == 2 || x == 1);
16}
Note: See TracBrowser for help on using the repository browser.