[llvm-commits] [compiler-rt] r157187 - /compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Dmitry Vyukov
dvyukov at google.com
Mon May 21 07:24:20 PDT 2012
Author: dvyukov
Date: Mon May 21 09:24:20 2012
New Revision: 157187
URL: http://llvm.org/viewvc/llvm-project?rev=157187&view=rev
Log:
tsan: do not assume non-recursive signal handlers
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=157187&r1=157186&r2=157187&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Mon May 21 09:24:20 2012
@@ -1216,38 +1216,38 @@
TSAN_INTERCEPTOR(int, raise, int sig) {
SCOPED_TSAN_INTERCEPTOR(raise, sig);
- CHECK_EQ(thr->int_signal_send, 0);
+ int prev = thr->int_signal_send;
thr->int_signal_send = sig;
int res = REAL(raise)(sig);
CHECK_EQ(thr->int_signal_send, sig);
- thr->int_signal_send = 0;
+ thr->int_signal_send = prev;
return res;
}
TSAN_INTERCEPTOR(int, kill, int pid, int sig) {
SCOPED_TSAN_INTERCEPTOR(kill, pid, sig);
+ int prev = thr->int_signal_send;
if (pid == GetPid()) {
- CHECK_EQ(thr->int_signal_send, 0);
thr->int_signal_send = sig;
}
int res = REAL(kill)(pid, sig);
if (pid == GetPid()) {
CHECK_EQ(thr->int_signal_send, sig);
- thr->int_signal_send = 0;
+ thr->int_signal_send = prev;
}
return res;
}
TSAN_INTERCEPTOR(int, pthread_kill, void *tid, int sig) {
SCOPED_TSAN_INTERCEPTOR(pthread_kill, tid, sig);
+ int prev = thr->int_signal_send;
if (tid == pthread_self()) {
- CHECK_EQ(thr->int_signal_send, 0);
thr->int_signal_send = sig;
}
int res = REAL(pthread_kill)(tid, sig);
if (tid == pthread_self()) {
CHECK_EQ(thr->int_signal_send, sig);
- thr->int_signal_send = 0;
+ thr->int_signal_send = prev;
}
return res;
}
More information about the llvm-commits
mailing list