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"
|
||||
} // namespace __tsan
|
||||
|
|
|
@ -93,6 +93,11 @@ void ThreadClock::acq_rel(SyncClock *dst) {
|
|||
release(dst);
|
||||
}
|
||||
|
||||
void ThreadClock::Disable() {
|
||||
for (uptr i = 0; i < kMaxTidInClock; i++)
|
||||
clk_[i] = (u64)-1;
|
||||
}
|
||||
|
||||
SyncClock::SyncClock()
|
||||
: clk_(MBlockClock) {
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ struct ThreadClock {
|
|||
nclk_ = tid + 1;
|
||||
}
|
||||
|
||||
void Disable();
|
||||
|
||||
uptr size() const {
|
||||
return nclk_;
|
||||
}
|
||||
|
|
|
@ -437,6 +437,7 @@ int ThreadTid(ThreadState *thr, uptr pc, uptr uid);
|
|||
void ThreadJoin(ThreadState *thr, uptr pc, int tid);
|
||||
void ThreadDetach(ThreadState *thr, uptr pc, int tid);
|
||||
void ThreadFinalize(ThreadState *thr);
|
||||
void ThreadFinalizerGoroutine(ThreadState *thr);
|
||||
|
||||
void MutexCreate(ThreadState *thr, uptr pc, uptr addr, bool rw, bool recursive);
|
||||
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,
|
||||
uptr size, bool is_write) {
|
||||
if (size == 0)
|
||||
|
|
Loading…
Reference in New Issue