Kaydet (Commit) cf2a8078 authored tarafından Victor Stinner's avatar Victor Stinner

faulthandler: don't use sigprocmask()

It has an undefined behaviour with threads, only use pthread_sigmask() if
it is available (and not broken).
üst 4571ee0b
...@@ -418,16 +418,12 @@ faulthandler_thread(void *unused) ...@@ -418,16 +418,12 @@ faulthandler_thread(void *unused)
const char* errmsg; const char* errmsg;
PyThreadState *current; PyThreadState *current;
int ok; int ok;
#ifdef HAVE_PTHREAD_H #if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
sigset_t set; sigset_t set;
/* we don't want to receive any signal */ /* we don't want to receive any signal */
sigfillset(&set); sigfillset(&set);
#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
pthread_sigmask(SIG_SETMASK, &set, NULL); pthread_sigmask(SIG_SETMASK, &set, NULL);
#else
sigprocmask(SIG_SETMASK, &set, NULL);
#endif
#endif #endif
do { do {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment