tsan: fix Go build with TSAN_COLLECT_STATS

Go does not have cur_thread function.

llvm-svn: 210345
This commit is contained in:
Dmitry Vyukov 2014-06-06 15:50:29 +00:00
parent 8744b1c1e3
commit 4f6de1d684
1 changed files with 2 additions and 2 deletions

View File

@ -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;