diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-30 13:21:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-30 13:21:58 (GMT) |
commit | a92933596156337cc004027e41073db6d68616b9 (patch) | |
tree | 581f92c46d9bb5302e5dc49007b2998a58ac19e8 /Lib/test/test_io.py | |
parent | d5c355ccc70d011ef2010537838d9a82e24b2b80 (diff) | |
download | cpython-a92933596156337cc004027e41073db6d68616b9.zip cpython-a92933596156337cc004027e41073db6d68616b9.tar.gz cpython-a92933596156337cc004027e41073db6d68616b9.tar.bz2 |
Issue #8407, issue #11859: Add signal.pthread_sigmask() function to fetch
and/or change the signal mask of the calling thread.
Fix also tests of test_io using threads and an alarm: use pthread_sigmask() to
ensure that the SIGALRM signal is received by the main thread.
Original patch written by Jean-Paul Calderone.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 1821492..8d293d0 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2627,6 +2627,8 @@ class SignalsTest(unittest.TestCase): in the latter.""" read_results = [] def _read(): + if hasattr(signal, 'pthread_sigmask'): + signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGALRM]) s = os.read(r, 1) read_results.append(s) t = threading.Thread(target=_read) |