This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, python-dev, vstinner
Date 2011-04-18.10:40:29
SpamBayes Score 0.0001568208
Marked as misclassified No
Message-id <1303123231.01.0.0893225357862.issue11768@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
History
Date User Action Args
2011-04-18 10:40:31vstinnersetrecipients: + vstinner, pitrou, python-dev
2011-04-18 10:40:31vstinnersetmessageid: <1303123231.01.0.0893225357862.issue11768@psf.upfronthosting.co.za>
2011-04-18 10:40:30vstinnerlinkissue11768 messages
2011-04-18 10:40:30vstinnercreate