[Openmp-commits] [openmp] r258528 - Add missing cleanup code for cached indirect lock pool.

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Fri Jan 22 11:16:15 PST 2016

Author: jlpeyton
Date: Fri Jan 22 13:16:14 2016
New Revision: 258528

URL: http://llvm.org/viewvc/llvm-project?rev=258528&view=rev
Add missing cleanup code for cached indirect lock pool.

This change fixes one issue reported at https://llvm.org/bugs/show_bug.cgi?id=26184
There was missing cleanup code for the cached indirect lock pool. The change
will fix the reported case where it tries to initialize a lock after runtime
cleanup/reinitialization, but it is still possible that the user program runs
into another problem because most test programs have a call to __kmpc_set_lock
after cleanup/reinitialization without calling __kmpc_init_lock causing a crash/hang.


Modified: openmp/trunk/runtime/src/kmp_lock.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_lock.cpp?rev=258528&r1=258527&r2=258528&view=diff
--- openmp/trunk/runtime/src/kmp_lock.cpp (original)
+++ openmp/trunk/runtime/src/kmp_lock.cpp Fri Jan 22 13:16:14 2016
@@ -3578,6 +3578,7 @@ __kmp_cleanup_indirect_user_locks()
             ll->lock = NULL;
+        __kmp_indirect_lock_pool[k] = NULL;
     // Clean up the remaining undestroyed locks.
     for (i = 0; i < __kmp_i_lock_table.next; i++) {

More information about the Openmp-commits mailing list