tsan: fix mutex in Go mode

In Go it's legal to unlock from a different goroutine.

llvm-svn: 210358
This commit is contained in:
Dmitry Vyukov 2014-06-06 18:04:05 +00:00
parent 80fb253fa7
commit d858fa77d6
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ int MutexUnlock(ThreadState *thr, uptr pc, uptr addr, bool all) {
TraceAddEvent(thr, thr->fast_state, EventTypeUnlock, s->GetId());
int rec = 0;
bool report_bad_unlock = false;
if (s->recursion == 0 || s->owner_tid != thr->tid) {
if (kCppMode && (s->recursion == 0 || s->owner_tid != thr->tid)) {
if (flags()->report_mutex_bugs && !s->is_broken) {
s->is_broken = true;
report_bad_unlock = true;