diff -c -r python.orig/dist/src/Python/thread_pthread.h python/dist/src/Python/thread_pthread.h *** python.orig/dist/src/Python/thread_pthread.h 2004-03-04 11:00:56.000000000 -0500 --- python/dist/src/Python/thread_pthread.h 2004-05-06 12:22:52.000000000 -0400 *************** *** 109,114 **** --- 109,153 ---- #endif /* !_HAVE_BSDI */ + static sigset_t + PyThread__block_signals(sigset_t *oldmask) + { + sigset_t newmask; + sigfillset(&newmask); + + #if defined(SIGILL) + sigdelset(&newmask, SIGILL); + #endif + + #if defined(SIGABRT) + sigdelset(&newmask, SIGABRT); + #endif + + #if defined(SIGFPE) + sigdelset(&newmask, SIGFPE); + #endif + + #if defined(SIGSEGV) + sigdelset(&newmask, SIGSEGV); + #endif + + #if defined(SIGBUS) + sigdelset(&newmask, SIGBUS); + #endif + + #if defined(SIGSYS) + sigdelset(&newmask, SIGSYS); + #endif + + SET_THREAD_SIGMASK(SIG_BLOCK, &newmask, oldmask); + } + + static void + PyThread__restore_signals(sigset_t *mask) + { + SET_THREAD_SIGMASK(SIG_SETMASK, mask, NULL); + } + /* * Thread support. */ *************** *** 119,125 **** { pthread_t th; int status; ! sigset_t oldmask, newmask; #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_t attrs; #endif --- 158,164 ---- { pthread_t th; int status; ! sigset_t oldmask; #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_t attrs; #endif *************** *** 137,148 **** pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif ! /* Mask all signals in the current thread before creating the new ! * thread. This causes the new thread to start with all signals ! * blocked. */ ! sigfillset(&newmask); ! SET_THREAD_SIGMASK(SIG_BLOCK, &newmask, &oldmask); status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) --- 176,186 ---- pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); #endif ! /* Mask all appropriate signals in the current thread before ! * creating the new thread. This causes the new thread to ! * start with all signals blocked. */ ! PyThread__block_signals(&oldmask); status = pthread_create(&th, #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) *************** *** 155,161 **** ); /* Restore signal mask for original thread */ ! SET_THREAD_SIGMASK(SIG_SETMASK, &oldmask, NULL); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); --- 193,199 ---- ); /* Restore signal mask for original thread */ ! PyThread__restore_signals(&oldmask); #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs);