Fix for Fix for https://bugs.llvm.org/show_bug.cgi?id=36705.

Differential Revision: https://reviews.llvm.org/D44637


git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@327875 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/runtime/src/kmp_runtime.cpp b/runtime/src/kmp_runtime.cpp
index a092a0e..0e96190 100644
--- a/runtime/src/kmp_runtime.cpp
+++ b/runtime/src/kmp_runtime.cpp
@@ -5476,6 +5476,7 @@
     balign[b].bb.leaf_kids = 0;
   }
   this_th->th.th_task_state = 0;
+  this_th->th.th_reap_state = KMP_SAFE_TO_REAP;
 
   /* put thread back on the free pool */
   TCW_PTR(this_th->th.th_team, NULL);