forked from OSchip/llvm-project
tsan: fix Go build with TSAN_COLLECT_STATS
Go does not have cur_thread function. llvm-svn: 210345
This commit is contained in:
parent
8744b1c1e3
commit
4f6de1d684
|
@ -234,7 +234,7 @@ void Mutex::Lock() {
|
|||
cmp = kUnlocked;
|
||||
if (atomic_compare_exchange_weak(&state_, &cmp, kWriteLock,
|
||||
memory_order_acquire)) {
|
||||
#if TSAN_COLLECT_STATS
|
||||
#if TSAN_COLLECT_STATS && !TSAN_GO
|
||||
StatInc(cur_thread(), stat_type_, backoff.Contention());
|
||||
#endif
|
||||
return;
|
||||
|
@ -262,7 +262,7 @@ void Mutex::ReadLock() {
|
|||
for (Backoff backoff; backoff.Do();) {
|
||||
prev = atomic_load(&state_, memory_order_acquire);
|
||||
if ((prev & kWriteLock) == 0) {
|
||||
#if TSAN_COLLECT_STATS
|
||||
#if TSAN_COLLECT_STATS && !TSAN_GO
|
||||
StatInc(cur_thread(), stat_type_, backoff.Contention());
|
||||
#endif
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue