[Python-Dev] Problem with signals in a single threaded application (original) (raw)

Ulisses Furquim ulissesf at gmail.com
Sun Jan 28 02🔞00 CET 2007


On 1/27/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Why not?

Correct me if I'm wrong, but what I got from the OP was that the current method does if (istripped) { for each signal { if the signal has occurred, call its handler } istripped = 0; } and the problem is that any setting of istripped that occurs in the midst of calling the handlers gets wiped out at the end. Changing this to while (istripped) { for each signal { if the signal has occurred, call its handler } istripped = 0; } doesn't solve that, because istripped still gets set to 0 before it's tested again.

Agreed.

Thinking about it more, probably it doesn't. What's important is to clear it before testing whether any handlers need to be called, i.e.

if (istripped) { istripped = 0; for each signal { if the signal has occurred, call its handler } }

That's exactly what my patch does as you can see here:

http://www.python.org/sf/1643738

Regards,

-- Ulisses



More information about the Python-Dev mailing list