%PDF- %PDF-
Direktori : /usr/local/lib/python2.7/test/ |
Current File : //usr/local/lib/python2.7/test/test_dummy_threading.pyc |
ó Nêáac @ sp d d l m Z d d l Z d d l Z d d l Z d e j f d „ ƒ YZ d „ Z e d k rl e ƒ n d S( iÿÿÿÿ( t test_supportNt DummyThreadingTestCasec B s3 e Z d e j f d „ ƒ YZ d „ Z d „ Z RS( t TestThreadc B s e Z d „ Z RS( c C sÜ d } t j r* d G| j Gd G| Gd GHn t j ƒ t j ƒ t d 7a t j r] t Gd GHn t j ƒ t j | ƒ t j r d G| j Gd GHn t j ƒ t d 8a t j rÄ | j Gd Gt Gd GHn t j ƒ t j ƒ d S( Ni t tasks will run fort seci s tasks are runningt dones is finished.( R t verboset namet semat acquiret mutext runningt releaset timet sleep( t selft delay( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyt run s$ ( t __name__t __module__R ( ( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyR s c C s: d | _ t j d d ƒ a t j ƒ a d a g | _ d S( Ni t valuei i ( t numtaskst _threadingt BoundedSemaphoreR t RLockR R t threads( R ( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyt setUp$ s c C sŽ xG t | j ƒ D]6 } | j d d | ƒ } | j j | ƒ | j ƒ q Wt j r[ d GHn x | j D] } | j ƒ qe Wt j rŠ d GHn d S( NR s <thread %d>s! waiting for all tasks to completes all tasks done( t rangeR R R t appendt startR R t join( R t it t( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyt test_tasks. s ( R R R t ThreadR R R! ( ( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyR s c C s t j t ƒ d S( N( R t run_unittestR ( ( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyt test_main; s t __main__( t testR t unittestt dummy_threadingR R t TestCaseR R$ R ( ( ( s5 /usr/local/lib/python2.7/test/test_dummy_threading.pyt <module> s 5