[compiler-rt] [llvm] [tsan] Introduce Adaptive Delay Scheduling to TSAN (PR #178836)
Chris Cotter via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 13 12:35:30 PST 2026
================
@@ -1371,20 +1383,23 @@ INTERCEPTOR(int, pthread_cond_signal, void *c) {
void *cond = init_cond(c);
SCOPED_TSAN_INTERCEPTOR(pthread_cond_signal, cond);
MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), false);
+ GetFuzzingScheduler().MutexCvOp();
return REAL(pthread_cond_signal)(cond);
}
INTERCEPTOR(int, pthread_cond_broadcast, void *c) {
void *cond = init_cond(c);
SCOPED_TSAN_INTERCEPTOR(pthread_cond_broadcast, cond);
MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), false);
+ GetFuzzingScheduler().MutexCvOp();
return REAL(pthread_cond_broadcast)(cond);
}
INTERCEPTOR(int, pthread_cond_destroy, void *c) {
void *cond = init_cond(c);
SCOPED_TSAN_INTERCEPTOR(pthread_cond_destroy, cond);
MemoryAccessRange(thr, pc, (uptr)c, sizeof(uptr), true);
+ GetFuzzingScheduler().MutexCvOp();
----------------
ccotter wrote:
My thinking was to help catch races where another thread attempts to use a cv after it's been destroyed. But, thinking about it more, I do not think this delay helps, since it's the *other* thread that needs to be delayed, not the thread doing the destroy. I will remove this one.
https://github.com/llvm/llvm-project/pull/178836
More information about the llvm-commits
mailing list