1414process_pid = os .getpid ()
1515signalled_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
1822def 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