forked from OSchip/llvm-project
tsan: start the background thread with signals blocked, otherwise it can steal users signals
llvm-svn: 193519
This commit is contained in:
parent
981fdeb477
commit
33dd200ba9
|
@ -2191,9 +2191,15 @@ void InitializeInterceptors() {
|
|||
}
|
||||
|
||||
void internal_start_thread(void(*func)(void *arg), void *arg) {
|
||||
// Start the thread with signals blocked, otherwise it can steal users
|
||||
// signals.
|
||||
__sanitizer_kernel_sigset_t set, old;
|
||||
internal_sigfillset(&set);
|
||||
internal_sigprocmask(SIG_SETMASK, &set, &old);
|
||||
void *th;
|
||||
REAL(pthread_create)(&th, 0, (void*(*)(void *arg))func, arg);
|
||||
REAL(pthread_detach)(th);
|
||||
internal_sigprocmask(SIG_SETMASK, &old, 0);
|
||||
}
|
||||
|
||||
} // namespace __tsan
|
||||
|
|
Loading…
Reference in New Issue