[Python-checkins] cpython (merge 3.1 -> 3.2): (Merge 3.1) Issue #12060: Use sig_atomic_t type and volatile keyword in the

victor.stinner python-checkins at python.org
Sun May 15 10:27:59 CEST 2011


http://hg.python.org/cpython/rev/b74999f561ca
changeset:   70138:b74999f561ca
branch:      3.2
parent:      70133:7089afd69a1a
parent:      70137:945ca78c38b1
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sun May 15 10:27:09 2011 +0200
summary:
  (Merge 3.1) Issue #12060: Use sig_atomic_t type and volatile keyword in the
signal module. Patch written by Charles-François Natali.

files:
  Misc/NEWS              |  3 +++
  Modules/signalmodule.c |  6 +++---
  2 files changed, 6 insertions(+), 3 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 Core and Builtins
 -----------------
 
+- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
+  module. Patch written by Charles-François Natali.
+
 - Issue #12044: Fixed subprocess.Popen when used as a context manager to
   wait for the process to end when exiting the context to avoid unintentionally
   leaving zombie processes around.
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -80,12 +80,12 @@
 static pid_t main_pid;
 #endif
 
-static struct {
-    int tripped;
+static volatile struct {
+    sig_atomic_t tripped;
     PyObject *func;
 } Handlers[NSIG];
 
-static sig_atomic_t wakeup_fd = -1;
+static volatile sig_atomic_t wakeup_fd = -1;
 
 /* Speed up sigcheck() when none tripped */
 static volatile sig_atomic_t is_tripped = 0;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list