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

30 lines
459 B
C

/*
* @@name: tasking.7c
* @@type: C
* @@compilable: yes
* @@linkable: no
* @@expect: success
*/
int tp;
#pragma omp threadprivate(tp)
int var;
void work()
{
#pragma omp task
{
/* do work here */
#pragma omp task
{
tp = 1;
/* do work here */
#pragma omp task
{
/* no modification of tp */
}
var = tp; //value of tp can be 1 or 2
}
tp = 2;
}
}