source: CIVL/examples/languageFeatures/yieldTest/local_and_yield.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 404 bytes
Line 
1/* Threads t0 and t1 are all wrapped in $local_begin and $local_end.
2 With $yield, both interleaves: t0 first then t1 and the other way
3 around will be explored by CIVL. Hence the assertion violation
4 will be found.
5 */
6
7int x = -1;
8
9void thread(int tid) {
10 $local_start();
11 $yield();
12 x = tid;
13 $local_end();
14}
15
16int main() {
17 $parfor (int i : 0 .. 1)
18 thread(i);
19 $assert(x == 1);
20}
Note: See TracBrowser for help on using the repository browser.