OpenMP-Examples/sources/Example_tasking.12.c

19 lines
262 B
C

/*
* @@name: tasking.12c
* @@type: C
* @@compilable: yes
* @@linkable: no
* @@expect: rt-error
*/
#include <stdio.h>
void foo ( )
{
int x = 2;
#pragma omp task mergeable
{
x++;
}
#pragma omp taskwait
printf("%d\n",x); // prints 2 or 3
}