tsan: minor refactoring

Replace duplicate code snippet with function.

llvm-svn: 192357
This commit is contained in:
Dmitry Vyukov 2013-10-10 16:03:24 +00:00
parent 72ace5cf12
commit 3431b38067
1 changed files with 1 additions and 6 deletions

View File

@ -138,12 +138,7 @@ int MutexUnlock(ThreadState *thr, uptr pc, uptr addr, bool all) {
if (s->recursion == 0) {
StatInc(thr, StatMutexUnlock);
s->owner_tid = SyncVar::kInvalidTid;
if (thr->ignore_sync == 0) {
thr->clock.set(thr->tid, thr->fast_state.epoch());
thr->fast_synch_epoch = thr->fast_state.epoch();
thr->clock.ReleaseStore(&s->clock);
StatInc(thr, StatSyncRelease);
}
ReleaseStoreImpl(thr, pc, &s->clock);
} else {
StatInc(thr, StatMutexRecUnlock);
}