[STATS] Fix stats lock problem to be compatible with new hinted lock code
llvm-svn: 255901
diff --git a/openmp/runtime/src/kmp_global.c b/openmp/runtime/src/kmp_global.c
index 55ef4e6..bdac75b 100644
--- a/openmp/runtime/src/kmp_global.c
+++ b/openmp/runtime/src/kmp_global.c
@@ -22,7 +22,7 @@
#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;
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index 0cf34e9..39d59b5 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -6333,6 +6333,9 @@
__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 );