fixed test: eliminated race condition which might cause deadlock
authorAndrey Churbanov <Andrey.Churbanov@intel.com>
Wed, 25 Sep 2019 15:25:52 +0000 (15:25 +0000)
committerAndrey Churbanov <Andrey.Churbanov@intel.com>
Wed, 25 Sep 2019 15:25:52 +0000 (15:25 +0000)
llvm-svn: 372887

openmp/runtime/test/tasking/omp_fill_taskqueue.c

index e95f97a..17e1de3 100644 (file)
@@ -29,7 +29,6 @@ int main()
 {
   int i;
   int block = 1;
-  int tid;
   int throttling = strcmp(getenv("KMP_ENABLE_TASK_THROTTLING"), "1") == 0;
   int enqueued = 0;
   int failed = -1;
@@ -41,6 +40,7 @@ int main()
       enqueued++;
       #pragma omp task
       {
+        int tid;
         tid = omp_get_thread_num();
         if (tid == 0) {
           // As soon as the master thread starts executing task we should unlock