[compiler-rt] r353627 - tsan: Implement pthread_exit() interceptor for Thread sanitizer
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 9 14:08:31 PST 2019
Author: vitalybuka
Date: Sat Feb 9 14:08:31 2019
New Revision: 353627
URL: http://llvm.org/viewvc/llvm-project?rev=353627&view=rev
Log:
tsan: Implement pthread_exit() interceptor for Thread sanitizer
This change is preparation for fiber support.
Author: yuri (Yuri Per)
Reviewed in: https://reviews.llvm.org/D57876
Context: https://reviews.llvm.org/D54889
llvm-svn: 353385
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=353627&r1=353626&r2=353627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Sat Feb 9 14:08:31 2019
@@ -1050,6 +1050,13 @@ TSAN_INTERCEPTOR(int, pthread_detach, vo
return res;
}
+TSAN_INTERCEPTOR(void, pthread_exit, void *retval) {
+ {
+ SCOPED_INTERCEPTOR_RAW(pthread_exit, retval);
+ }
+ REAL(pthread_exit)(retval);
+}
+
#if SANITIZER_LINUX
TSAN_INTERCEPTOR(int, pthread_tryjoin_np, void *th, void **ret) {
SCOPED_TSAN_INTERCEPTOR(pthread_tryjoin_np, th, ret);
@@ -2664,6 +2671,7 @@ void InitializeInterceptors() {
TSAN_INTERCEPT(pthread_create);
TSAN_INTERCEPT(pthread_join);
TSAN_INTERCEPT(pthread_detach);
+ TSAN_INTERCEPT(pthread_exit);
#if SANITIZER_LINUX
TSAN_INTERCEPT(pthread_tryjoin_np);
TSAN_INTERCEPT(pthread_timedjoin_np);
More information about the llvm-commits
mailing list