1
0
mirror of https://github.com/OpenMP/Examples.git synced 2025-04-11 00:42:12 +01:00
OpenMP-Examples/sources/Example_tasking.11c.c
2015-01-13 11:38:24 -08:00

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
}