ó
ŠwÛjc           @   sH  d  Z  d d l Z d d l Z d d l m Z m Z d d l Z d d l Z d d l m	 Z
 d „  Z d e f d „  ƒ  YZ d e j f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   s/   
Various tests for synchronization primitives.
iÿÿÿÿN(   t   start_new_threadt	   get_ident(   t   test_supportc           C   s   t  j d ƒ d  S(   Ng{®Gáz„?(   t   timet   sleep(    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   _wait   s    t   Bunchc           B   s5   e  Z d  Z e d „ Z d „  Z d „  Z d „  Z RS(   s   
    A bunch of threads.
    c            s‚   ˆ  ˆ _  | ˆ _ g  ˆ _ g  ˆ _ | ˆ _ ‡  ‡ f d †  } y( x! t | ƒ D] } t | d ƒ qP WWn t ˆ _ ‚  n Xd S(   s¹   
        Construct a bunch of `n` threads running the same function `f`.
        If `wait_before_exit` is True, the threads won't terminate until
        do_finish() is called.
        c             sS   t  ƒ  }  ˆ j j |  ƒ z ˆ  ƒ  Wd  ˆ j j |  ƒ x ˆ j sM t ƒ  q: WXd  S(   N(   R   t   startedt   appendt   finishedt	   _can_exitR   (   t   tid(   t   ft   self(    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   task!   s    	N(    (   R   t   nR   R	   R
   t   rangeR    t   True(   R   R   R   t   wait_before_exitR   t   i(    (   R   R   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   __init__   s    				
		c         C   s*   x# t  |  j ƒ |  j k  r% t ƒ  q Wd  S(   N(   t   lenR   R   R   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   wait_for_started1   s    c         C   s*   x# t  |  j ƒ |  j k  r% t ƒ  q Wd  S(   N(   R   R	   R   R   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   wait_for_finished5   s    c         C   s   t  |  _ d  S(   N(   R   R
   (   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt	   do_finish9   s    (   t   __name__t
   __module__t   __doc__t   FalseR   R   R   R   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR      s
   		t   BaseTestCasec           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  j ƒ  |  _ d  S(   N(   t   supportt   threading_setupt   _threads(   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   setUp>   s    c         C   s   t  j |  j Œ  t  j ƒ  d  S(   N(   R   t   threading_cleanupR    t   reap_children(   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   tearDownA   s    (   R   R   R!   R$   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   =   s   	t   BaseLockTestsc           B   sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s;   
    Tests for both recursive and non-recursive locks.
    c         C   s   |  j  ƒ  } ~ d  S(   N(   t   locktype(   R   t   lock(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_constructorK   s    c         C   s   |  j  ƒ  } | j ƒ  ~ d  S(   N(   R&   t   acquire(   R   R'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_acquire_destroyO   s    
c         C   s'   |  j  ƒ  } | j ƒ  | j ƒ  ~ d  S(   N(   R&   R)   t   release(   R   R'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_acquire_releaseT   s    

c         C   s0   |  j  ƒ  } |  j | j t ƒ ƒ | j ƒ  d  S(   N(   R&   t
   assertTrueR)   R   R+   (   R   R'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_try_acquireZ   s    c            s`   |  j  ƒ  ‰  ˆ  j ƒ  g  ‰ ‡  ‡ f d †  } t | d ƒ j ƒ  |  j ˆ d ƒ ˆ  j ƒ  d  S(   Nc              s   ˆ j  ˆ  j t ƒ ƒ d  S(   N(   R   R)   R   (    (   R'   t   result(    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   c   s    i   i    (   R&   R)   R   R   t   assertFalseR+   (   R   R   (    (   R'   R/   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_try_acquire_contended_   s    
c            s•   |  j  ƒ  ‰  ˆ  j ƒ  d } ‡  f d †  } t | | ƒ } | j ƒ  t ƒ  |  j t | j ƒ d ƒ ˆ  j ƒ  | j	 ƒ  |  j t | j ƒ | ƒ d  S(   Ni   c              s   ˆ  j  ƒ  ˆ  j ƒ  d  S(   N(   R)   R+   (    (   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   m   s    
i    (
   R&   R)   R   R   R   t   assertEqualR   R	   R+   R   (   R   t   NR   t   b(    (   R'   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_acquire_contendedi   s    



c            sq   |  j  ƒ  ‰  ‡  f d †  } d  ‡  f d † } | ƒ  t | d ƒ j ƒ  |  j t | t ƒ t | d ƒ j ƒ  d  S(   Nc              s   ˆ  j  ƒ  ˆ  j ƒ  d  S(   N(   R)   R+   (    (   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   {   s    
c            s&   ˆ  � |  d  k	 r |  ‚ n  Wd  QXd  S(   N(   t   None(   t   err(   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   _with~   s    i   (   R&   R6   R   R   t   assertRaisest	   TypeError(   R   R   R8   (    (   R'   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt	   test_withy   s    c            s`   |  j  ƒ  ‰  ‡  f d †  } t t j ƒ  ƒ } t | d ƒ j ƒ  |  j | t t j ƒ  ƒ ƒ d  S(   Nc              s   ˆ  j  ƒ  ˆ  j ƒ  d  S(   N(   R)   R+   (    (   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   �   s    
i   (   R&   R   t	   threadingt	   enumerateR   R   R2   (   R   R   R   (    (   R'   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_thread_leak‰   s
    (   R   R   R   R(   R*   R,   R.   R1   R5   R;   R>   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR%   F   s   					
		t	   LockTestsc           B   s    e  Z d  Z d „  Z d „  Z RS(   sn   
    Tests for non-recursive, weak locks
    (which can be acquired and released from different threads).
    c            s²   |  j  ƒ  ‰  g  ‰ ‡  ‡ f d †  } t | d ƒ x t ˆ ƒ d k rP t ƒ  q4 Wt ƒ  |  j t ˆ ƒ d ƒ ˆ  j ƒ  x t ˆ ƒ d k r— t ƒ  q{ W|  j t ˆ ƒ d ƒ d  S(   Nc              s2   ˆ  j  ƒ  ˆ j d  ƒ ˆ  j  ƒ  ˆ j d  ƒ d  S(   N(   R)   R   R6   (    (   R'   t   phase(    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR       s    

i    i   i   (    (   R&   R    R   R   R2   R+   (   R   R   (    (   R'   R@   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_reacquireœ   s    
c            sV   |  j  ƒ  ‰  ˆ  j ƒ  ‡  f d †  } t | d ƒ } | j ƒ  ˆ  j ƒ  ˆ  j ƒ  d  S(   Nc              s   ˆ  j  ƒ  d  S(   N(   R+   (    (   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   ³   s    i   (   R&   R)   R   R   R+   (   R   R   R4   (    (   R'   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_different_thread¯   s    


(   R   R   R   RA   RB   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR?   —   s   	t
   RLockTestsc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s$   
    Tests for recursive locks.
    c         C   sL   |  j  ƒ  } | j ƒ  | j ƒ  | j ƒ  | j ƒ  | j ƒ  | j ƒ  d  S(   N(   R&   R)   R+   (   R   R'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRA   ¿   s    




c         C   sr   |  j  ƒ  } |  j t | j ƒ | j ƒ  | j ƒ  | j ƒ  | j ƒ  | j ƒ  | j ƒ  |  j t | j ƒ d  S(   N(   R&   R9   t   RuntimeErrorR+   R)   (   R   R'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_release_unacquiredÈ   s    





c            sV   |  j  ƒ  ‰  ‡  f d †  } t | d t ƒ } z |  j t ˆ  j ƒ Wd  | j ƒ  Xd  S(   Nc              s   ˆ  j  ƒ  d  S(   N(   R)   (    (   R'   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   ×   s    i   (   R&   R   R   R9   RD   R+   R   (   R   R   R4   (    (   R'   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRB   Ô   s    c            sÓ   |  j  ƒ  ‰  |  j ˆ  j ƒ  ƒ ˆ  j ƒ  |  j ˆ  j ƒ  ƒ ˆ  j ƒ  |  j ˆ  j ƒ  ƒ g  ‰ ‡  ‡ f d †  } t | d ƒ j ƒ  |  j ˆ d ƒ ˆ  j ƒ  |  j ˆ  j ƒ  ƒ ˆ  j ƒ  |  j ˆ  j ƒ  ƒ d  S(   Nc              s   ˆ j  ˆ  j ƒ  ƒ d  S(   N(   R   t	   _is_owned(    (   R'   R/   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   ç   s    i   i    (   R&   R0   RF   R)   R-   R   R   R+   (   R   R   (    (   R'   R/   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test__is_ownedß   s    



(   R   R   R   RA   RE   RB   RG   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRC   »   s
   				t
   EventTestsc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s"   
    Tests for Event objects.
    c         C   s—   |  j  ƒ  } |  j | j ƒ  ƒ | j ƒ  |  j | j ƒ  ƒ | j ƒ  |  j | j ƒ  ƒ | j ƒ  |  j | j ƒ  ƒ | j ƒ  |  j | j ƒ  ƒ d  S(   N(   t	   eventtypeR0   t   is_sett   setR-   t   clear(   R   t   evt(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_is_setö   s    



c            s£   d } g  ‰ g  ‰ ‡  ‡ ‡ f d †  } t  | | ƒ } | j ƒ  t ƒ  |  j t ˆ ƒ d ƒ ˆ  j ƒ  | j ƒ  |  j ˆ t g | ƒ |  j ˆ t g | ƒ d  S(   Ni   c              s*   ˆ j  ˆ  j ƒ  ƒ ˆ j  ˆ  j ƒ  ƒ d  S(   N(   R   t   wait(    (   RM   t   results1t   results2(    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR     s    i    (   R   R   R   R2   R   RK   R   R   (   R   RM   R3   R   R4   (    (   RM   RP   RQ   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   _check_notify  s    


c         C   s>   |  j  ƒ  } |  j | ƒ | j ƒ  | j ƒ  |  j | ƒ d  S(   N(   RI   RR   RK   RL   (   R   RM   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_notify  s
    

c            sÿ   |  j  ƒ  ‰  g  ‰ g  ‰ d } ‡  ‡ ‡ f d †  } t | | ƒ j ƒ  |  j ˆ t g | ƒ x7 ˆ D]/ \ } } |  j | ƒ |  j | d k | ƒ qd Wg  ‰ g  ‰ ˆ  j ƒ  t | | ƒ j ƒ  |  j ˆ t g | ƒ x! ˆ D] \ } } |  j | ƒ qÞ Wd  S(   Ni   c             sX   ˆ j  ˆ  j d ƒ ƒ t j ƒ  }  ˆ  j d ƒ } t j ƒ  } ˆ j  | | |  f ƒ d  S(   Ng        gš™™™™™É?(   R   RO   R   (   t   t1t   rt   t2(   RM   RP   RQ   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR      s
    gš™™™™™É?(	   RI   R   R   R2   R   R0   R-   RK   R   (   R   R3   R   RU   t   dt(    (   RM   RP   RQ   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_timeout  s"    
c         C   s^   |  j  ƒ  } | j j } | j ƒ  | j j } |  j | | ƒ |  j t | ƒ t | ƒ ƒ d  S(   N(   RI   t   _Event__condt   _Condition__lockt   _reset_internal_lockst   assertIsNott   assertIst   type(   R   RM   t   old_lockt   new_lock(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_reset_internal_locks4  s    
(   R   R   R   RN   RR   RS   RX   Ra   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRH   ñ   s   				t   ConditionTestsc           B   sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s(   
    Tests for condition variables.
    c         C   sÖ   |  j  ƒ  } | j ƒ  | j ƒ  | j ƒ  | j ƒ  t j ƒ  } |  j  | ƒ } | j ƒ  |  j | j t ƒ ƒ | j ƒ  |  j | j t ƒ ƒ |  j | j t ƒ ƒ | j ƒ  | � |  j | j t ƒ ƒ Wd  QXd  S(   N(   t   condtypeR)   R+   R<   t   LockR0   R   R-   (   R   t   condR'   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_acquireB  s    






c         C   s#   |  j  ƒ  } |  j t | j ƒ d  S(   N(   Rc   R9   RD   RO   (   R   Re   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_unacquired_waitU  s    c         C   s#   |  j  ƒ  } |  j t | j ƒ d  S(   N(   Rc   R9   RD   t   notify(   R   Re   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_unacquired_notifyY  s    c            sk  d } g  ‰ g  ‰ g  ‰ d ‰ ‡  ‡ ‡ ‡ ‡ f d †  } t  | | ƒ } | j ƒ  x t ˆ ƒ d k  rq t ƒ  qU Wg  ‰ |  j ˆ g  ƒ ˆ  j ƒ  ˆ  j d ƒ t ƒ  d ‰ ˆ  j ƒ  x t ˆ ƒ d k  rÕ t ƒ  q¹ W|  j ˆ d g d ƒ |  j ˆ g  ƒ x t ˆ ƒ d k  rt ƒ  q Wˆ  j ƒ  ˆ  j d ƒ t ƒ  d ‰ ˆ  j ƒ  x' t ˆ ƒ t ˆ ƒ d k  rtt ƒ  qNW|  j ˆ d g d d g d ƒ |  j ˆ d g d ƒ x t ˆ ƒ d k  rÍt ƒ  q±Wˆ  j ƒ  ˆ  j ƒ  t ƒ  d ‰ ˆ  j ƒ  x t ˆ ƒ d k  rt ƒ  qüW|  j ˆ d g d d g d ƒ |  j ˆ d g d d g d ƒ | j	 ƒ  d  S(   Ni   i    c              st   ˆ  j  ƒ  ˆ j ˆ ƒ ˆ  j ƒ  ˆ  j ƒ  ˆ j ˆ ƒ ˆ  j  ƒ  ˆ j ˆ ƒ ˆ  j ƒ  ˆ  j ƒ  ˆ j ˆ ƒ d  S(   N(   R)   R   RO   R+   (    (   Re   t	   phase_numt   readyRP   RQ   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   n  s    





i   i   i   i   (
   R   R   R   R   R2   R)   Rh   R+   t
   notify_allR   (   R   Re   R3   R   R4   (    (   Re   Rj   Rk   RP   RQ   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRR   ]  sX    




"


""c         C   s*   |  j  ƒ  } |  j | ƒ |  j | ƒ d  S(   N(   Rc   RR   (   R   Re   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRS   §  s    c            s~   |  j  ƒ  ‰  g  ‰ d } ‡  ‡ f d †  } t | | ƒ j ƒ  |  j t ˆ ƒ d ƒ x$ ˆ D] } |  j | d k | ƒ qZ Wd  S(   Ni   c             sN   ˆ  j  ƒ  t j ƒ  }  ˆ  j d ƒ t j ƒ  } ˆ  j ƒ  ˆ j | |  ƒ d  S(   Ngš™™™™™É?(   R)   R   RO   R+   R   (   RT   RV   (   Re   t   results(    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   ±  s    

gš™™™™™É?(   Rc   R   R   R2   R   R-   (   R   R3   R   RW   (    (   Re   Rm   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRX   ­  s    (	   R   R   R   Rf   Rg   Ri   RR   RS   RX   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRb   =  s   				J	t   BaseSemaphoreTestsc           B   sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   sB   
    Common tests for {bounded, unbounded} semaphore objects.
    c         C   s:   |  j  t |  j d d ƒ|  j  t |  j d t j ƒd  S(   Nt   valueiÿÿÿÿ(   R9   t
   ValueErrort   semtypet   syst   maxint(   R   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR(   Ã  s    c         C   s^   |  j  d ƒ } | j ƒ  | j ƒ  |  j  d ƒ } | j ƒ  | j ƒ  | j ƒ  | j ƒ  d  S(   Ni   i   (   Rq   R)   R+   (   R   t   sem(    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRf   Ç  s    




c         C   s   |  j  ƒ  } | j ƒ  ~ d  S(   N(   Rq   R)   (   R   Rt   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR*   Ñ  s    
c            sÚ  |  j  d ƒ ‰ ˆ j ƒ  d } g  ‰ g  ‰ d ‰  ‡  ‡ ‡ ‡ f d †  } t | d ƒ } | j ƒ  x' t ˆ ƒ t ˆ ƒ d k  r‹ t ƒ  qe W|  j ˆ ˆ d g d ƒ d ‰  x t d ƒ D] } ˆ j ƒ  qº Wx' t ˆ ƒ t ˆ ƒ d k  r÷ t ƒ  qÑ W|  j t	 ˆ ˆ ƒ d g d d g d ƒ d ‰  x t d ƒ D] } ˆ j ƒ  q7Wx' t ˆ ƒ t ˆ ƒ d	 k  rtt ƒ  qNW|  j t	 ˆ ˆ ƒ d g d d g d d g d ƒ |  j
 ˆ j t ƒ ƒ ˆ j ƒ  | j ƒ  d  S(
   Ni   i
   i    c              s2   ˆ j  ƒ  ˆ j ˆ  ƒ ˆ j  ƒ  ˆ j ˆ  ƒ d  S(   N(   R)   R   (    (   Rj   RP   RQ   Rt   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR   Ý  s    

i   i   i   i   i   (   Rq   R)   R   R   R   R   R2   R   R+   t   sortedR0   R   R   (   R   R3   R   R4   R   (    (   Rj   RP   RQ   Rt   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR5   Ö  s6    

,7
c         C   su   |  j  d ƒ } |  j | j t ƒ ƒ |  j | j t ƒ ƒ |  j | j t ƒ ƒ | j ƒ  |  j | j t ƒ ƒ d  S(   Ni   (   Rq   R-   R)   R   R0   R+   (   R   Rt   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR.   ù  s    
c            sp   |  j  d ƒ ‰ ˆ j ƒ  g  ‰  ‡  ‡ f d †  } t | d ƒ j ƒ  |  j t ˆ  ƒ t g d t g d ƒ d  S(   Ni   c              s0   ˆ  j  ˆ j t ƒ ƒ ˆ  j  ˆ j t ƒ ƒ d  S(   N(   R   R)   R   (    (   Rm   Rt   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR     s    i   i   i   (   Rq   R)   R   R   R2   Ru   R   R   (   R   R   (    (   Rm   Rt   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR1     s    
c            sm   |  j  ƒ  ‰  ˆ  j ƒ  ‡  f d †  } t | d ƒ } | j ƒ  t ƒ  |  j | j ƒ ˆ  j ƒ  | j ƒ  d  S(   Nc              s   ˆ  j  ƒ  ˆ  j ƒ  d  S(   N(   R)   R+   (    (   Rt   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR     s    
i   (	   Rq   R)   R   R   R   R0   R	   R+   R   (   R   R   R4   (    (   Rt   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   test_default_value  s    


c            s‚   ˆ  j  d ƒ ‰ d  ‡  ‡ f d † } | ƒ  ˆ  j ˆ j t ƒ ƒ ˆ j ƒ  ˆ  j t | t ƒ ˆ  j ˆ j t ƒ ƒ ˆ j ƒ  d  S(   Ni   c            sc   ˆ �W ˆ  j  ˆ j t ƒ ƒ ˆ j ƒ  ˆ �* ˆ  j ˆ j t ƒ ƒ |  rS |  ‚ n  Wd  QXWd  QXd  S(   N(   R-   R)   R   R+   R0   (   R7   (   R   Rt   (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR8     s    
(   Rq   R6   R-   R)   R   R+   R9   R:   (   R   R8   (    (   R   Rt   s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyR;     s    
(   R   R   R   R(   Rf   R*   R5   R.   R1   Rv   R;   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRn   ¾  s   		
		#			t   SemaphoreTestsc           B   s   e  Z d  Z d „  Z RS(   s)   
    Tests for unbounded semaphores.
    c         C   s;   |  j  d ƒ } | j ƒ  | j ƒ  | j ƒ  | j ƒ  d  S(   Ni   (   Rq   R+   R)   (   R   Rt   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRE   2  s
    


(   R   R   R   RE   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRw   -  s   t   BoundedSemaphoreTestsc           B   s   e  Z d  Z d „  Z RS(   s'   
    Tests for bounded semaphores.
    c         C   sJ   |  j  ƒ  } |  j t | j ƒ | j ƒ  | j ƒ  |  j t | j ƒ d  S(   N(   Rq   R9   Rp   R+   R)   (   R   Rt   (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRE   @  s
    

(   R   R   R   RE   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyRx   ;  s   (   R   Rr   R   t   threadR    R   R<   t   unittestt   testR   R   R   t   objectR   t   TestCaseR   R%   R?   RC   RH   Rb   Rn   Rw   Rx   (    (    (    s…   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/lock_tests.pyt   <module>   s"   	+	Q$6L�o