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:
Dmitry Vyukov 2018-06-22 08:27:52 +00:00
parent 032db94ac9
commit ac5fa6605c
1 changed files with 1 additions and 1 deletions

View File

@ -361,7 +361,7 @@ void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr) {
if (s->recursion == 0) {
StatInc(thr, StatMutexUnlock);
s->owner_tid = SyncVar::kInvalidTid;
ReleaseImpl(thr, pc, &s->clock);
ReleaseStoreImpl(thr, pc, &s->clock);
} else {
StatInc(thr, StatMutexRecUnlock);
}