File1: #include <stdio.h>\n#include <omp.h>\n\nint main(){\n\n  int x = 0, y;\n\n  #pragma omp parallel num_threads(2)\n  {\n    int thrd = omp_get_thread_num();\n    if (thrd == 0) {\n      #pragma omp critical\n      { x = 10; }\n      #pragma omp atomic write\n      y = 1;\n    } else {\n      int tmp = 0;\n      while (tmp == 0) {\n        #pragma omp atomic read acquire\n        tmp = y;\n    }\n    #pragma omp critical\n    { if (x!=10) printf("x = %d\n", x); }\n    }\n  }\n  return 0;\n}\n
File2: program DRB142_acquirerelease_orig_yes\n    use omp_lib\n    implicit none\n\n    integer :: x, y, thrd\n    integer :: tmp\n    x = 0\n\n    !$omp parallel num_threads(2) private(thrd) private(tmp)\n        thrd = omp_get_thread_num()\n        if (thrd == 0) then\n            !$omp critical\n            x = 10\n            !$omp end critical\n            !$omp atomic write\n            y = 1\n            !$omp end atomic\n        else\n            tmp = 0\n            do while(tmp == 0)\n            !$omp atomic read acquire ! or seq_cst\n            tmp = x\n            !$omp end atomic\n            end do\n            !$omp critical\n            print *, "x = ", x\n            !$omp end critical\n        end if\n    !$omp end parallel\nend program