diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-19 21:30:57 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-19 21:30:57 (GMT) |
commit | cf2a807831ee93ef39e73fcc682894b0695b6143 (patch) | |
tree | e1bdacbf00530577688259d4b9c14c9de6b45a74 /Modules | |
parent | 4571ee0b781e569612d04572050792faa66f02af (diff) | |
download | cpython-cf2a807831ee93ef39e73fcc682894b0695b6143.zip cpython-cf2a807831ee93ef39e73fcc682894b0695b6143.tar.gz cpython-cf2a807831ee93ef39e73fcc682894b0695b6143.tar.bz2 |
faulthandler: don't use sigprocmask()
It has an undefined behaviour with threads, only use pthread_sigmask() if
it is available (and not broken).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/faulthandler.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index abedd5b..48c4391 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -418,16 +418,12 @@ faulthandler_thread(void *unused) const char* errmsg; PyThreadState *current; int ok; -#ifdef HAVE_PTHREAD_H +#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) sigset_t set; /* we don't want to receive any signal */ sigfillset(&set); -#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK) pthread_sigmask(SIG_SETMASK, &set, NULL); -#else - sigprocmask(SIG_SETMASK, &set, NULL); -#endif #endif do { |