Charles-François Natali <neolo...@free.fr> added the comment:

I just noticed something "funny": signal_sigwait doesn't release the
GIL, which means that it's pretty much useless :-)
Patch attached.
Also, test_sigwait doesn't block the signal before calling sigwait: it
happens to work because there's only one thread, but it's undefined
behaviour.

----------
Added file: http://bugs.python.org/file22300/sigwait_gil.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8407>
_______________________________________
--- cpython-302424b84b07/Modules/signalmodule.c 2011-06-01 02:39:38.000000000 
+0000
+++ cpython/Modules/signalmodule.c      2011-06-09 11:39:28.000000000 +0000
@@ -662,7 +662,9 @@
     if (iterable_to_sigset(signals, &set))
         return NULL;
 
+    Py_BEGIN_ALLOW_THREADS
     err = sigwait(&set, &signum);
+    Py_END_ALLOW_THREADS
     if (err) {
         errno = err;
         return PyErr_SetFromErrno(PyExc_OSError);
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to