source:
CIVL/examples/languageFeatures/yieldTest/yield_purely_local.cvl@
8abfd3a
| Last change on this file since 8abfd3a was 87e98a4, checked in by , 7 years ago | |
|---|---|
|
|
| File size: 319 bytes | |
| Rev | Line | |
|---|---|---|
| [87e98a4] | 1 | /* Both threads have no access to the shared object hence the $yield |
| 2 | is a no-op. Otherwise, this test can run for an unendurable time. | |
| 3 | */ | |
| 4 | ||
| 5 | int x = -1; | |
| 6 | ||
| 7 | void thread(int tid) { | |
| 8 | int x; | |
| 9 | ||
| 10 | for (int i = 0; i < 100; i++) { | |
| 11 | x = tid; | |
| 12 | $yield(); | |
| 13 | } | |
| 14 | } | |
| 15 | ||
| 16 | int main() { | |
| 17 | $parfor (int i : 0 .. 4) | |
| 18 | thread(i); | |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
