]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12060: Use sig_atomic_t type and volatile keyword in the signal module.
authorVictor Stinner <victor.stinner@haypocalc.com>
Sun, 15 May 2011 08:21:59 +0000 (10:21 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sun, 15 May 2011 08:21:59 +0000 (10:21 +0200)
Patch written by Charles-François Natali.

Misc/NEWS
Modules/signalmodule.c

index 8618363e2ddb40651b05dbf436e3153891227f47..c41e475cc94cbd3961cf2fa4080d6dd572d089a1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.1.4?
 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 #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
   clear the end-of-file indicator after CTRL+d.
 
index 14297709c51d3afcea795171c3c0c636df251c78..5a6c777fb542011beccc4a2d705db65b1508191e 100644 (file)
@@ -78,12 +78,12 @@ static long main_thread;
 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;