From: Victor Stinner Date: Thu, 23 Jun 2011 12:22:28 +0000 (+0200) Subject: Issue #11223: skip also test_rlock_acquire_interruption() on FreeBSD6 X-Git-Tag: v3.2.1rc2~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66f7d66174b0898e436ea821309ee47a1b297a8f;p=thirdparty%2FPython%2Fcpython.git Issue #11223: skip also test_rlock_acquire_interruption() on FreeBSD6 --- diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py index 9162c864638b..e0af31dae472 100644 --- a/Lib/test/test_threadsignals.py +++ b/Lib/test/test_threadsignals.py @@ -14,6 +14,10 @@ if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos': 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) @@ -70,10 +74,7 @@ class ThreadSignals(unittest.TestCase): 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 @@ -96,6 +97,8 @@ class ThreadSignals(unittest.TestCase): 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.