libgomp: Implementing SINGLE construct

1 
1 9.14 Implementing SINGLE construct
1 ==================================
1 
1 A block like
1 
1        #pragma omp single
1        {
1          body;
1        }
1 
1    becomes
1 
1        if (GOMP_single_start ())
1          body;
1        GOMP_barrier ();
1 
1    while
1 
1        #pragma omp single copyprivate(x)
1          body;
1 
1    becomes
1 
1        datap = GOMP_single_copy_start ();
1        if (datap == NULL)
1          {
1            body;
1            data.x = x;
1            GOMP_single_copy_end (&data);
1          }
1        else
1          x = datap->x;
1        GOMP_barrier ();
1