[PATCH] D75080: [profile] gcov_mutex must be static
calixte via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 24 14:38:35 PST 2020
calixte created this revision.
calixte added a reviewer: erik.pilkington.
Herald added subscribers: llvm-commits, Sanitizers, dexonsmith.
Herald added projects: Sanitizers, LLVM.
Forget static keyword for gcov_mutex in https://reviews.llvm.org/D74953 and that causes test failure on mac.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75080
Files:
compiler-rt/lib/profile/GCDAProfiling.c
Index: compiler-rt/lib/profile/GCDAProfiling.c
===================================================================
--- compiler-rt/lib/profile/GCDAProfiling.c
+++ compiler-rt/lib/profile/GCDAProfiling.c
@@ -67,12 +67,12 @@
#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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75080.246310.patch
Type: text/x-patch
Size: 800 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200224/bee22b1d/attachment.bin>
More information about the llvm-commits
mailing list