aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python25/files
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2009-02-27 09:25:32 +0800
committersobomax <sobomax@FreeBSD.org>2009-02-27 09:25:32 +0800
commit91fb651a8e9ea5c9717a9f7260af283336d99ba3 (patch)
tree48132ebb4c7abcf081976dd7efe830e23934abb4 /lang/python25/files
parent417cae0cc0be2e1d2c7e7f7ba7ae37e15c007feb (diff)
downloadfreebsd-ports-gnome-91fb651a8e9ea5c9717a9f7260af283336d99ba3.tar.gz
freebsd-ports-gnome-91fb651a8e9ea5c9717a9f7260af283336d99ba3.tar.zst
freebsd-ports-gnome-91fb651a8e9ea5c9717a9f7260af283336d99ba3.zip
Make sure the singal is delivered to the main thread, where python
runs its signal handlers, not to a random thread that happens to be executing at the time when signal arrives. This functionality has been lost since Python 2.3, possible cause is that the linux implementation of POSIX threads always delivered signal to the main thread. This bug results in rather annoying inability to terminate threading script with ^C for example and there could be other issues as well. Bump PORTREVISION. PR: ports/131080 Submitted by: Andriy Pylypenko <bamby@sippysoft.com> Approved by: MAINTAINER's timeout
Diffstat (limited to 'lang/python25/files')
-rw-r--r--lang/python25/files/patch-Python_thread__pthread.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/lang/python25/files/patch-Python_thread__pthread.h b/lang/python25/files/patch-Python_thread__pthread.h
new file mode 100644
index 000000000000..1e11c3ad36c3
--- /dev/null
+++ b/lang/python25/files/patch-Python_thread__pthread.h
@@ -0,0 +1,30 @@
+
+$FreeBSD$
+
+--- ../Python/thread_pthread.h
++++ ../Python/thread_pthread.h
+@@ -149,6 +149,7 @@
+ {
+ pthread_t th;
+ int status;
++ sigset_t set, oset;
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_t attrs;
+ #endif
+@@ -177,6 +178,8 @@
+ #if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
+ #endif
++ sigfillset(&set);
++ SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
+
+ status = pthread_create(&th,
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+@@ -188,6 +191,7 @@
+ (void *)arg
+ );
+
++ SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
+ #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
+ pthread_attr_destroy(&attrs);
+ #endif