Author vstinner
Recipients pitrou, python-dev, vstinner
Date 2011-04-18.10:40:29
SpamBayes Score 0.000156821
Marked as misclassified No
Message-id <>
> 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
Date User Action Args
2011-04-18 10:40:31vstinnersetrecipients: + vstinner, pitrou, python-dev
2011-04-18 10:40:31vstinnersetmessageid: <>
2011-04-18 10:40:30vstinnerlinkissue11768 messages
2011-04-18 10:40:30vstinnercreate