/* Both threads have no access to the shared object hence the $yield is a no-op. Otherwise, this test can run for an unendurable time. */ int x = -1; void thread(int tid) { int x; for (int i = 0; i < 100; i++) { x = tid; $yield(); } } int main() { $parfor (int i : 0 .. 4) thread(i); }