OpenMP-Examples/synchronization/sources/worksharing_critical.1.c
2022-11-04 09:35:42 -07:00

28 lines
402 B
C

/*
* @@name: worksharing_critical.1
* @@type: C
* @@operation: compile
* @@expect: success
* @@version: pre_omp_3.0
*/
void critical_work()
{
int i = 1;
#pragma omp parallel sections
{
#pragma omp section
{
#pragma omp critical (name)
{
#pragma omp parallel
{
#pragma omp single
{
i++;
}
}
}
}
}
}