From: Matthias Klose Date: Wed, 1 Dec 2004 07:36:58 +0000 (+0000) Subject: Taken from 2.4/HEAD: X-Git-Tag: v2.3.5c1~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c57bd881ea65d7cce7df7ddd9600718c8e1ea405;p=thirdparty%2FPython%2Fcpython.git Taken from 2.4/HEAD: - Bug #875692: Improve signal handling, especially when using threads, by forcing an early re-execution of PyEval_EvalFrame() "periodic" code when things_to_do is not cleared by Py_MakePendingCalls(). --- diff --git a/Misc/NEWS b/Misc/NEWS index 89e0216212ae..eb4b302bd851 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -36,6 +36,10 @@ Core and builtins - Bug #845802: Python crashed when __init__.py is a directory. +- Bug #875692: Improve signal handling, especially when using threads, by + forcing an early re-execution of PyEval_EvalFrame() "periodic" code when + things_to_do is not cleared by Py_MakePendingCalls(). + Extension modules ----------------- diff --git a/Python/ceval.c b/Python/ceval.c index 035520a593b5..d98dbe11d3a1 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -785,6 +785,12 @@ eval_frame(PyFrameObject *f) why = WHY_EXCEPTION; goto on_error; } + if (things_to_do) + /* MakePendingCalls() didn't succeed. + Force early re-execution of this + "periodic" code, possibly after + a thread switch */ + _Py_Ticker = 0; } #if !defined(HAVE_SIGNAL_H) || defined(macintosh) /* If we have true signals, the signal handler