This is an archive of the discontinued LLVM Phabricator instance.

tsan: remove thread initialization check from interceptors
AcceptedPublic

Authored by dvyukov on Oct 26 2021, 7:56 AM.

Details

Reviewers
vitalybuka
melver
Summary

Currently entry into each interceptor checks if the current thread
is initialized or not. This check seems to be unnecessary at least
on Linux. Remove the check.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Oct 26 2021, 7:56 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2021, 7:56 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Oct 26 2021, 7:59 AM
melver added inline comments.
compiler-rt/lib/tsan/rtl/tsan_interceptors.h
44

Is this what breaks on other platforms?

This revision is now accepted and ready to land.Oct 26 2021, 7:59 AM
melver added inline comments.Oct 26 2021, 8:12 AM
compiler-rt/lib/tsan/rtl/tsan_interceptors.h
44

Ah, what happens if !SANITIZER_CAN_USE_PREINIT_ARRAY?