Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
test
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/test/test_threadsignals.pyc
mň =5Dc @ sď d Z d k Z d k Z d k Z d k Z d k Z d k l Z l Z e i d d j p e i d j o e d e i n e i Z e i Z d Z d Z d Z d e i f d YZ d Z e d j o e n d S( s6 PyUnit testing that threads honor our signal semanticsN( s run_unittests TestSkippedi t wint os2t riscoss Can't test signal on %sc C s[ | \ } } } t i t i | } t i t i | } t i t i | } | | | f S( N( t for_usr1t for_usr2t for_alrmt signalt SIGUSR1t usr1t SIGUSR2t usr2t SIGALRMt alrm( t .0R R R R R R ( ( t- /usr/lib/python2.4/test/test_threadsignals.pyt registerSignals s c C s, t | d c d 7<t i t | d <d S( Nt trippedi t tripped_by( t signal_blackboardt sigt threadt get_ident( R t frame( ( R t handle_signals s c C s4 t i t t i t i t t i t i d S( N( t ost killt process_pidR R R t signalled_allt release( ( ( R t send_signals s t ThreadSignalsc B s t Z d Z d Z d Z RS( sŢ Test signal handling semantics of threads. We spawn a thread, have the thread send two signals, and wait for it to finish. Check that we got both signals and that they were run by the main thread. c C sü t i | i t i t t i d d j p t t i d d j o( t i d t i t i d n | i t t i d d | i t t i d t i | i t t i d d | i t t i d t i t i d S( NR i i R ( R t acquiret selft spawnSignallingThreadR R R t alarmt pauset assertEqualR R R R ( R ( ( R t test_signals* s 0 c C s t i t f d S( N( R t start_new_threadR ( R ( ( R R! B s ( t __name__t __module__t __doc__R% R! ( ( ( R R $ s c C s h t i h d d <d d <<t i h d d <d d <<t i h d d <d d <<a t t t t f } z t t Wd t | Xd S( NR i R ( R R R R R R R t oldsigst run_unittestR ( R* ( ( R t test_mainF s ` t __main__( R R ( R) t unittestR R R t syst test.test_supportR+ t TestSkippedt platformt getpidR t allocate_lockR R R R t TestCaseR R, R' ( R1 R R. R R/ R R R+ R R R R R R, ( ( R t ? s"