OpenMP-Examples/sources/Example_tasking.11.c

19 lines
266 B
C

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