Skip to content

Commit 62c7d84

Browse files
committed
[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
1 parent ccee390 commit 62c7d84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/lib/profile/GCDAProfiling.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ typedef unsigned long long uint64_t;
6767

6868
#ifndef _WIN32
6969
#include <pthread.h>
70-
pthread_mutex_t gcov_mutex = PTHREAD_MUTEX_INITIALIZER;
70+
static pthread_mutex_t gcov_mutex = PTHREAD_MUTEX_INITIALIZER;
7171
static __inline void gcov_lock() { pthread_mutex_lock(&gcov_mutex); }
7272
static __inline void gcov_unlock() { pthread_mutex_unlock(&gcov_mutex); }
7373
#else
7474
#include <windows.h>
75-
SRWLOCK gcov_mutex = SRWLOCK_INIT;
75+
static SRWLOCK gcov_mutex = SRWLOCK_INIT;
7676
static __inline void gcov_lock() { AcquireSRWLockExclusive(&gcov_mutex); }
7777
static __inline void gcov_unlock() { ReleaseSRWLockExclusive(&gcov_mutex); }
7878
#endif

0 commit comments

Comments
 (0)