[Openmp-commits] [PATCH] D61944: Fixed https://bugs.llvm.org/show_bug.cgi?id=41584

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed May 15 06:56:38 PDT 2019

AndreyChurbanov created this revision.
AndreyChurbanov added reviewers: tlwilmar, jlpeyton, hbae.
AndreyChurbanov added a project: OpenMP.
Herald added subscribers: openmp-commits, jdoerfert, jfb.

Removed unconditional unsafe counter decrement at shutdown 
that may cause it to become negative if a thread was not active_in_pool 
(e.g. is sleeping, or already exited). Same action is done safely on the next line - 
inside the call to __kmp_reap_thread.

  rOMP OpenMP



Index: runtime/src/kmp_runtime.cpp
--- runtime/src/kmp_runtime.cpp
+++ runtime/src/kmp_runtime.cpp
@@ -6139,8 +6139,6 @@
       KMP_DEBUG_ASSERT(thread->th.th_reap_state == KMP_SAFE_TO_REAP);
       thread->th.th_next_pool = NULL;
       thread->th.th_in_pool = FALSE;
-      thread->th.th_active_in_pool = FALSE;
-      KMP_ATOMIC_DEC(&__kmp_thread_pool_active_nth);
       __kmp_reap_thread(thread, 0);
     __kmp_thread_pool_insert_pt = NULL;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61944.199601.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190515/3a5d9966/attachment.bin>

More information about the Openmp-commits mailing list