mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
d5c355ccc7
commit
a929335961
6 changed files with 262 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue