Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66f7d66

Browse files
author
Victor Stinner
committed
Issue #11223: skip also test_rlock_acquire_interruption() on FreeBSD6
1 parent f25ae48 commit 66f7d66

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Lib/test/test_threadsignals.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
process_pid = os.getpid()
1515
signalled_all=thread.allocate_lock()
1616

17+
# Issue #11223: Locks are implemented using a mutex and a condition variable of
18+
# the pthread library on FreeBSD6. POSIX condition variables cannot be
19+
# interrupted by signals (see pthread_cond_wait manual page).
20+
USING_PTHREAD_COND = (sys.platform == 'freebsd6')
1721

1822
def registerSignals(for_usr1, for_usr2, for_alrm):
1923
usr1 = signal.signal(signal.SIGUSR1, for_usr1)
@@ -70,10 +74,7 @@ def spawnSignallingThread(self):
7074
def alarm_interrupt(self, sig, frame):
7175
raise KeyboardInterrupt
7276

73-
# Issue #11223: Locks are implemented using a mutex and a condition
74-
# variable of the pthread library on FreeBSD6. POSIX condition variables
75-
# cannot be interrupted by signals (see pthread_cond_wait manual page).
76-
@unittest.skipIf(sys.platform == 'freebsd6',
77+
@unittest.skipIf(USING_PTHREAD_COND,
7778
'POSIX condition variables cannot be interrupted')
7879
def test_lock_acquire_interruption(self):
7980
# Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
@@ -96,6 +97,8 @@ def test_lock_acquire_interruption(self):
9697
finally:
9798
signal.signal(signal.SIGALRM, oldalrm)
9899

100+
@unittest.skipIf(USING_PTHREAD_COND,
101+
'POSIX condition variables cannot be interrupted')
99102
def test_rlock_acquire_interruption(self):
100103
# Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
101104
# in a deadlock.

0 commit comments

Comments
 (0)