parent
d654f06644
commit
dfc8e52400
|
@ -221,5 +221,10 @@ void __tsan_event(int typ, int tid, void *pc, void *addr, int info) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __tsan_finalizer_goroutine(int tid) {
|
||||||
|
ThreadState *thr = goroutines[tid];
|
||||||
|
ThreadFinalizerGoroutine(thr);
|
||||||
|
}
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
} // namespace __tsan
|
} // namespace __tsan
|
||||||
|
|
|
@ -93,6 +93,11 @@ void ThreadClock::acq_rel(SyncClock *dst) {
|
||||||
release(dst);
|
release(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThreadClock::Disable() {
|
||||||
|
for (uptr i = 0; i < kMaxTidInClock; i++)
|
||||||
|
clk_[i] = (u64)-1;
|
||||||
|
}
|
||||||
|
|
||||||
SyncClock::SyncClock()
|
SyncClock::SyncClock()
|
||||||
: clk_(MBlockClock) {
|
: clk_(MBlockClock) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,8 @@ struct ThreadClock {
|
||||||
nclk_ = tid + 1;
|
nclk_ = tid + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Disable();
|
||||||
|
|
||||||
uptr size() const {
|
uptr size() const {
|
||||||
return nclk_;
|
return nclk_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,6 +437,7 @@ int ThreadTid(ThreadState *thr, uptr pc, uptr uid);
|
||||||
void ThreadJoin(ThreadState *thr, uptr pc, int tid);
|
void ThreadJoin(ThreadState *thr, uptr pc, int tid);
|
||||||
void ThreadDetach(ThreadState *thr, uptr pc, int tid);
|
void ThreadDetach(ThreadState *thr, uptr pc, int tid);
|
||||||
void ThreadFinalize(ThreadState *thr);
|
void ThreadFinalize(ThreadState *thr);
|
||||||
|
void ThreadFinalizerGoroutine(ThreadState *thr);
|
||||||
|
|
||||||
void MutexCreate(ThreadState *thr, uptr pc, uptr addr, bool rw, bool recursive);
|
void MutexCreate(ThreadState *thr, uptr pc, uptr addr, bool rw, bool recursive);
|
||||||
void MutexDestroy(ThreadState *thr, uptr pc, uptr addr);
|
void MutexDestroy(ThreadState *thr, uptr pc, uptr addr);
|
||||||
|
|
|
@ -298,6 +298,10 @@ void ThreadDetach(ThreadState *thr, uptr pc, int tid) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThreadFinalizerGoroutine(ThreadState *thr) {
|
||||||
|
thr->clock.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
void MemoryAccessRange(ThreadState *thr, uptr pc, uptr addr,
|
void MemoryAccessRange(ThreadState *thr, uptr pc, uptr addr,
|
||||||
uptr size, bool is_write) {
|
uptr size, bool is_write) {
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
|
|
Loading…
Reference in New Issue