/* * @@name: critical.1 * @@type: C * @@operation: compile * @@expect: success * @@version: pre_omp_3.0 */ int dequeue(float *a); void work(int i, float *a); void critical_example(float *x, float *y) { int ix_next, iy_next; #pragma omp parallel shared(x, y) private(ix_next, iy_next) { #pragma omp critical (xaxis) ix_next = dequeue(x); work(ix_next, x); #pragma omp critical (yaxis) iy_next = dequeue(y); work(iy_next, y); } }