summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threadsignals.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-18 14:30:17 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-18 14:30:17 (GMT)
commitce16be91dc68597b0c5bfc7b4b1c5136fe5697a6 (patch)
tree5d91e3854a67afbb2a7760b3d541cc2c3331db56 /Lib/test/test_threadsignals.py
parentf3299989a213f8e2f174defc1174ab2acf8ec322 (diff)
parent27026f87d8aba31c3aa5529971508a91017486f5 (diff)
downloadcpython-ce16be91dc68597b0c5bfc7b4b1c5136fe5697a6.zip
cpython-ce16be91dc68597b0c5bfc7b4b1c5136fe5697a6.tar.gz
cpython-ce16be91dc68597b0c5bfc7b4b1c5136fe5697a6.tar.bz2
(Merge 3.2) Issue #11768: The signal handler of the signal module only calls
Py_AddPendingCall() for the first signal to fix a deadlock on reentrant or parallel calls. PyErr_SetInterrupt() writes also into the wake up file.
Diffstat (limited to 'Lib/test/test_threadsignals.py')
-rw-r--r--Lib/test/test_threadsignals.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index fa26583..46e405a 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -30,14 +30,9 @@ def handle_signals(sig,frame):
# a function that will be spawned as a separate thread.
def send_signals():
- print("send_signals: enter (thread %s)" % thread.get_ident(), file=sys.stderr)
- print("send_signals: raise SIGUSR1", file=sys.stderr)
os.kill(process_pid, signal.SIGUSR1)
- print("send_signals: raise SIGUSR2", file=sys.stderr)
os.kill(process_pid, signal.SIGUSR2)
- print("send_signals: release signalled_all", file=sys.stderr)
signalled_all.release()
- print("send_signals: exit (thread %s)" % thread.get_ident(), file=sys.stderr)
class ThreadSignals(unittest.TestCase):
@@ -46,12 +41,9 @@ class ThreadSignals(unittest.TestCase):
# We spawn a thread, have the thread send two signals, and
# wait for it to finish. Check that we got both signals
# and that they were run by the main thread.
- print("test_signals: acquire lock (thread %s)" % thread.get_ident(), file=sys.stderr)
signalled_all.acquire()
self.spawnSignallingThread()
- print("test_signals: wait lock (thread %s)" % thread.get_ident(), file=sys.stderr)
signalled_all.acquire()
- print("test_signals: lock acquired", file=sys.stderr)
# the signals that we asked the kernel to send
# will come back, but we don't know when.
# (it might even be after the thread exits