forked from OSchip/llvm-project
tsan: fix deficiency in MutexReadOrWriteUnlock
MutexUnlock uses ReleaseStore on s->clock, which is the right thing to do. However MutexReadOrWriteUnlock for writers uses Release on s->clock. Make MutexReadOrWriteUnlock also use ReleaseStore for consistency and performance. Unfortunately, I don't think any test can detect this as this only potentially affects performance. llvm-svn: 335322
This commit is contained in:
parent
032db94ac9
commit
ac5fa6605c
|
|
@ -361,7 +361,7 @@ void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr) {
|
||||||
if (s->recursion == 0) {
|
if (s->recursion == 0) {
|
||||||
StatInc(thr, StatMutexUnlock);
|
StatInc(thr, StatMutexUnlock);
|
||||||
s->owner_tid = SyncVar::kInvalidTid;
|
s->owner_tid = SyncVar::kInvalidTid;
|
||||||
ReleaseImpl(thr, pc, &s->clock);
|
ReleaseStoreImpl(thr, pc, &s->clock);
|
||||||
} else {
|
} else {
|
||||||
StatInc(thr, StatMutexRecUnlock);
|
StatInc(thr, StatMutexRecUnlock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue