STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> I don't think so, please re-read.

Oh, I thought that Py_AddPendingCall() was used to store the pending signal. 
But no, it asks Python main loop to check which signal has been trigerred, and 
we can only do it once for all signals.

Attached patch should fix this issue:

 - signal_handler() and PyErr_SetInterrupt() only call Py_AddPendingCall() on 
the first signal (if is_tripped is zero): it should fix the deadlock and it is 
a micro optimization (win-win !)
 - PyErr_SetInterrupt() uses the wake up API (write "\0" into wakeup_fd, API 
introduced by issue #1583)
 - Remove debug code in test_threadsignals

Python 2.7 (and 2.6?) should also be patched: signal.set_wakeup_fd() and 
PySignal_SetWakeupFd() were introduced in 2.6, but there is no versionadded tag 
=> signal_versionadded.patch

----------
keywords: +patch
Added file: http://bugs.python.org/file21702/signal_reentrant.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11768>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to