[compiler-rt] 62c7d84 - [profile] gcov_mutex must be static
Calixte Denizet via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 01:55:04 PST 2020
Author: Calixte Denizet
Date: 2020-02-25T10:54:52+01:00
New Revision: 62c7d8402651a0704602e73c90da92248bbad6d5
URL: https://github.com/llvm/llvm-project/commit/62c7d8402651a0704602e73c90da92248bbad6d5
DIFF: https://github.com/llvm/llvm-project/commit/62c7d8402651a0704602e73c90da92248bbad6d5.diff
LOG: [profile] gcov_mutex must be static
Summary: Forget static keyword for gcov_mutex in https://reviews.llvm.org/D74953 and that causes test failure on mac.
Reviewers: erik.pilkington, vsk
Reviewed By: vsk
Subscribers: vsk, dexonsmith, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D75080
Added:
Modified:
compiler-rt/lib/profile/GCDAProfiling.c
Removed:
################################################################################
diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
index 7844b419b93c..98815dab541b 100644
--- a/compiler-rt/lib/profile/GCDAProfiling.c
+++ b/compiler-rt/lib/profile/GCDAProfiling.c
@@ -67,12 +67,12 @@ typedef unsigned long long uint64_t;
#ifndef _WIN32
#include <pthread.h>
-pthread_mutex_t gcov_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t gcov_mutex = PTHREAD_MUTEX_INITIALIZER;
static __inline void gcov_lock() { pthread_mutex_lock(&gcov_mutex); }
static __inline void gcov_unlock() { pthread_mutex_unlock(&gcov_mutex); }
#else
#include <windows.h>
-SRWLOCK gcov_mutex = SRWLOCK_INIT;
+static SRWLOCK gcov_mutex = SRWLOCK_INIT;
static __inline void gcov_lock() { AcquireSRWLockExclusive(&gcov_mutex); }
static __inline void gcov_unlock() { ReleaseSRWLockExclusive(&gcov_mutex); }
#endif
More information about the llvm-commits
mailing list