mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
25 lines
475 B
C
25 lines
475 B
C
/*
|
|
* @@name: tasking.9c
|
|
* @@type: C
|
|
* @@compilable: yes
|
|
* @@linkable: no
|
|
* @@expect: rt-error
|
|
*/
|
|
void work()
|
|
{
|
|
#pragma omp task
|
|
{ //Task 1
|
|
#pragma omp task
|
|
{ //Task 2
|
|
#pragma omp critical //Critical region 1
|
|
{/*do work here */ }
|
|
}
|
|
#pragma omp critical //Critical Region 2
|
|
{
|
|
//Capture data for the following task
|
|
#pragma omp task
|
|
{ /* do work here */ } //Task 3
|
|
}
|
|
}
|
|
}
|