mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
24 lines
323 B
C
24 lines
323 B
C
/*
|
|
* @@name: private.3c
|
|
* @@type: C
|
|
* @@compilable: yes
|
|
* @@linkable: no
|
|
* @@expect: success
|
|
*/
|
|
#include <assert.h>
|
|
void priv_example3()
|
|
{
|
|
int i, a;
|
|
|
|
#pragma omp parallel private(a)
|
|
{
|
|
a = 1;
|
|
#pragma omp parallel for private(a)
|
|
for (i=0; i<10; i++)
|
|
{
|
|
a = 2;
|
|
}
|
|
assert(a == 1);
|
|
}
|
|
}
|