[PATCH] D35016: [tsan] Use pthread_sigmask instead of sigprocmask to block signals in a thread on Darwin
Dmitry Vyukov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 5 10:36:51 PDT 2017
dvyukov added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:511
internal_sigfillset(&set);
- internal_sigprocmask(SIG_SETMASK, &set, &old);
+ pthread_sigmask(SIG_SETMASK, &set, &old);
pthread_t th;
----------------
I think you either need to (1) change implementation of internal_sigprocmask to follow the unofficial contract of affecting only the current thread, or (2) delete internal_sigprocmask.
(1) looks preferable to me as it will allow to write portable code for "unix" OSes, and make the code more consistent as we use __sanitizer_sigset_t and internal_sigfillset in this function, and move us closer to the ultimate goal of not using any library functions that loop into interceptors in favor of system calls (even if you use pthread_sigmask on implementation level for now).
Repository:
rL LLVM
https://reviews.llvm.org/D35016
More information about the llvm-commits
mailing list