Skip to content

Commit 8640266

Browse files
author
Julian Lettner
committed
Add fprintf debug output for TSan acquire/release
1 parent 743e56e commit 8640266

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/Concurrency/ThreadSanitizer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ TSanFunc *tsan_acquire, *tsan_release;
3131
void swift::_swift_tsan_acquire(void *addr) {
3232
if (tsan_acquire) {
3333
tsan_acquire(addr);
34+
#if SWIFT_TASK_PRINTF_DEBUG
35+
fprintf(stderr, "[%lu] tsan_acquire on %p\n", _swift_get_thread_id(), addr);
36+
#endif
3437
}
3538
}
3639

3740
void swift::_swift_tsan_release(void *addr) {
3841
if (tsan_release) {
3942
tsan_release(addr);
43+
#if SWIFT_TASK_PRINTF_DEBUG
44+
fprintf(stderr, "[%lu] tsan_release on %p\n", _swift_get_thread_id(), addr);
45+
#endif
4046
}
4147
}
4248

0 commit comments

Comments
 (0)