New submission from Zdenek Pavlas:
Quoting from signal module docs:
# Although Python signal handlers are called asynchronously as far as the
Python user is concerned, they can only occur between the “atomic” instructions
of the Python interpreter.
Yes, that's reasonable.
# This means
Zdenek Pavlas added the comment:
This patch isn't safe
Yes, it's broken. Does not work unless thread support was enabled, and locking
initialized. There are probably other bugs, too. Not meant to be included,
really. But IMO the correct implementation should work along these lines
Zdenek Pavlas added the comment:
for example, if you call malloc() from within a signal handler, you can get a
deadlock or a crash if the signal was received while the process was in the
middle of an malloc() call.
Thanks, I see the problem. malloc() implements locking (when threads