1.23
2.0
main
test-branch
| 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 |
|
|---|
| 7 | int x = -1;
|
|---|
| 8 |
|
|---|
| 9 | void thread(int tid) {
|
|---|
| 10 | $local_start();
|
|---|
| 11 | $yield();
|
|---|
| 12 | x = tid;
|
|---|
| 13 | $local_end();
|
|---|
| 14 | }
|
|---|
| 15 |
|
|---|
| 16 | int 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.