[Openmp-commits] [openmp] r255901 - [STATS] Fix stats lock problem to be compatible with new hinted lock code

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 17 08:19:05 PST 2015


Author: jlpeyton
Date: Thu Dec 17 10:19:05 2015
New Revision: 255901

URL: http://llvm.org/viewvc/llvm-project?rev=255901&view=rev
Log:
[STATS] Fix stats lock problem to be compatible with new hinted lock code

Modified:
    openmp/trunk/runtime/src/kmp_global.c
    openmp/trunk/runtime/src/kmp_runtime.c

Modified: openmp/trunk/runtime/src/kmp_global.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_global.c?rev=255901&r1=255900&r2=255901&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_global.c (original)
+++ openmp/trunk/runtime/src/kmp_global.c Thu Dec 17 10:19:05 2015
@@ -22,7 +22,7 @@ kmp_cpuinfo_t   __kmp_cpuinfo = { 0 }; /
 #if KMP_STATS_ENABLED
 #include "kmp_stats.h"
 // lock for modifying the global __kmp_stats_list
-kmp_tas_lock_t __kmp_stats_lock = KMP_TAS_LOCK_INITIALIZER(__kmp_stats_lock);
+kmp_tas_lock_t __kmp_stats_lock;
 
 // global list of per thread stats, the head is a sentinel node which accumulates all stats produced before __kmp_create_worker is called.
 kmp_stats_list __kmp_stats_list;

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=255901&r1=255900&r2=255901&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Thu Dec 17 10:19:05 2015
@@ -6333,6 +6333,9 @@ __kmp_do_serial_initialize( void )
     __kmp_init_speculative_stats();
 #endif
 #endif
+#if KMP_STATS_ENABLED
+    __kmp_init_tas_lock( & __kmp_stats_lock );
+#endif
     __kmp_init_lock( & __kmp_global_lock     );
     __kmp_init_queuing_lock( & __kmp_dispatch_lock );
     __kmp_init_lock( & __kmp_debug_lock      );




More information about the Openmp-commits mailing list