process_pid = os.getpid()
signalled_all=thread.allocate_lock()
+# Issue #11223: Locks are implemented using a mutex and a condition variable of
+# the pthread library on FreeBSD6. POSIX condition variables cannot be
+# interrupted by signals (see pthread_cond_wait manual page).
+USING_PTHREAD_COND = (sys.platform == 'freebsd6')
def registerSignals(for_usr1, for_usr2, for_alrm):
usr1 = signal.signal(signal.SIGUSR1, for_usr1)
def alarm_interrupt(self, sig, frame):
raise KeyboardInterrupt
- # Issue #11223: Locks are implemented using a mutex and a condition
- # variable of the pthread library on FreeBSD6. POSIX condition variables
- # cannot be interrupted by signals (see pthread_cond_wait manual page).
- @unittest.skipIf(sys.platform == 'freebsd6',
+ @unittest.skipIf(USING_PTHREAD_COND,
'POSIX condition variables cannot be interrupted')
def test_lock_acquire_interruption(self):
# Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
finally:
signal.signal(signal.SIGALRM, oldalrm)
+ @unittest.skipIf(USING_PTHREAD_COND,
+ 'POSIX condition variables cannot be interrupted')
def test_rlock_acquire_interruption(self):
# Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck
# in a deadlock.