Mercurial > cpython-lru_cache-weakref
diff Python/thread_pthread.h @ 32526:78bd25b42d46 legacy-trunk
This closes patch:
[ 960406 ] unblock signals in threads
although the changes do not correspond exactly to any patch attached to
that report.
Non-main threads no longer have all signals masked.
A different interface to readline is used.
The handling of signals inside calls to PyOS_Readline is now rather
different.
These changes are all a bit scary! Review and cross-platform testing
much appreciated.
| author | Michael W. Hudson <mwh@python.net> |
|---|---|
| date | Wed, 07 Jul 2004 17:44:12 +0000 |
| parents | c2df8a5c357e |
| children | fcb507414c41 |
line wrap: on
line diff
--- a/Python/thread_pthread.h Wed Jul 07 15:59:49 2004 +0000 +++ b/Python/thread_pthread.h Wed Jul 07 17:44:12 2004 +0000 @@ -119,7 +119,6 @@ { pthread_t th; int status; - sigset_t oldmask, newmask; #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_t attrs; #endif @@ -137,13 +136,6 @@ 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) &attrs, @@ -154,9 +146,6 @@ (void *)arg ); - /* 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); #endif
