]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Taken from 2.4/HEAD:
authorMatthias Klose <doko@ubuntu.com>
Wed, 1 Dec 2004 07:36:58 +0000 (07:36 +0000)
committerMatthias Klose <doko@ubuntu.com>
Wed, 1 Dec 2004 07:36:58 +0000 (07:36 +0000)
- 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().

Misc/NEWS
Python/ceval.c

index 89e0216212ae4352ffc3b4e267948c6422b522ec..eb4b302bd8514a8ad6b5bc5beef9c165c861e715 100644 (file)
--- 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
 -----------------
 
index 035520a593b5b14a6a9872ff2946cbb2a5276b60..d98dbe11d3a1af48c6a92aee6daab0e052726c44 100644 (file)
@@ -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