summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-15 08:27:49 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-15 08:27:49 (GMT)
commitaedb2823fd740dcdf64744d47eab0053324741b1 (patch)
treee9ab73cd2500e6360d5f79529033644765cbede2
parent5ed2e779f175dc648110a1d862e37d6e92bd2560 (diff)
parent5ebfe6d9a96beaa190e803259ffd05abe8786e14 (diff)
downloadcpython-aedb2823fd740dcdf64744d47eab0053324741b1.zip
cpython-aedb2823fd740dcdf64744d47eab0053324741b1.tar.gz
cpython-aedb2823fd740dcdf64744d47eab0053324741b1.tar.bz2
(Merge 3.2) Issue #12060: Use sig_atomic_t type and volatile keyword in the
signal module. Patch written by Charles-François Natali.
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/signalmodule.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index c8d15ec..04c4fbc 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
+- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal
+ module. Patch written by Charles-François Natali.
+
- Added the if_nameindex, if_indextoname, if_nametoindex methods to
the socket module as requested in issue #1746656.
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index feeae5e..ff65f04 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -88,12 +88,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;