OpenMP-Examples/sources/Example_tasking.11.c
2020-06-26 07:54:45 -07:00

20 lines
287 B
C

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