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

20 lines
283 B
C

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