ó
wŰjc           @   s   d  d l  Z  d  d l m Z m Z m Z e d  Z e j   a e j   a d   Z	 d   Z
 d   Z e d k r} e   n  d S(   i˙˙˙˙N(   t   verboset
   TestFailedt   import_modulet   threadc          C   s_   d d  l  }  |  j d d  } t j   t d 8a t d k } t j   | r[ t j   n  d  S(   Ni˙˙˙˙i   i   i    (   t   randomt	   randranget   critical_sectiont   acquiret   Nt   releaset   done(   R   t   xt   finished(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_threaded_import.pyt   task   s    


c          C   sj   d d  l  }  t r d Gn  d d  l } z3 | j j rI t | j j   n t rW d GHn  Wd  |  j d =Xd  S(   Ni˙˙˙˙s   testing import hangers ...s   OK.s   test.threaded_import_hangers(   t   sysR    t   test.threaded_import_hangerst   threaded_import_hangerst   errorsR   t   modules(   R   t   test(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_threaded_import.pyt   test_import_hangers   s    c          C   sŽ   d d  l  }  |  j   r* t j d   n  t j   xb d
 D]Z a t rV d Gt Gd Gn  x$ t t  D] } t	 j
 t d  qc Wt j   t r; d GHq; q; Wt j   t   d  S(   Ni˙˙˙˙s"   can't run when import lock is heldi   i2   i   t   Tryings   threads ...s   OK.(   i   i2   (   i   i2   i   i2   i   i2   (    (   t   impt	   lock_heldt   unittestt   SkipTestR
   R   R   R    t   rangeR   t   start_new_threadR   R	   R   (   R   t   i(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_threaded_import.pyt	   test_main6   s    


t   __main__(   R   t   test.test_supportR    R   R   R   t   allocate_lockR   R
   R   R   R   t   __name__(    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_threaded_import.pyt   <module>   s   			