[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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user