³ò
™›\Kc           @   s×  d  Z  d d k Z y d d k Z Wn  e j
 o e i e =‚  n Xd d k l Z l	 Z
 d d k l Z d d k l Z d d d d	 d
 d d d d d d d d d d g Z e i Z e i Z e i Z e i Z [ e Z d e f d „  ƒ  YZ d a d a d „  Z  d „  Z! e Z" d „  Z# d e f d „  ƒ  YZ$ d „  Z% d e f d „  ƒ  YZ& d „  Z' d  e f d! „  ƒ  YZ( d" „  Z) d# e( f d$ „  ƒ  YZ* d% „  Z+ d& e f d' „  ƒ  YZ, d( a- d) d* „ Z. e ƒ  Z/ h  Z0 h  Z1 d e f d+ „  ƒ  YZ2 d, „  Z3 d- e2 f d. „  ƒ  YZ4 d/ e2 f d0 „  ƒ  YZ5 d1 „  Z6 d2 e2 f d3 „  ƒ  YZ7 d4 „  Z8 d5 „  Z9 d6 „  Z: d d7 k l; Z; e5 ƒ  i< Z= y d d8 k l> Z? Wn# e j
 o d d9 k@ l? Z? n Xd: „  ZA e d; j o eA ƒ  n d S(<   s;   Thread module emulating a subset of Java's threading model.iÿÿÿÿN(   t   timet   sleep(   t
   format_exc(   t   dequet   activeCountt	   Conditiont   currentThreadt	   enumeratet   Eventt   Lockt   RLockt	   Semaphoret   BoundedSemaphoret   Threadt   Timert
   setprofilet   settracet   localt
   stack_sizet   _Verbosec           B   s   e  Z d d  „ Z d „  Z RS(   c         C   s$   | d  j o
 t } n | |  _ d  S(   N(   t   Nonet   _VERBOSEt   _Verbose__verbose(   t   selft   verbose(    (    s   /usr/lib/python2.5/threading.pyt   __init__'   s    
c         G   sE   |  i  o7 | | } d t ƒ  i ƒ  | f } t i i | ƒ n d  S(   Ns   %s: %s
(   R   R   t   getNamet   _syst   stderrt   write(   R   t   formatt   args(    (    s   /usr/lib/python2.5/threading.pyt   _note,   s
    

N(   t   __name__t
   __module__R   R   R    (    (    (    s   /usr/lib/python2.5/threading.pyR   %   s   c         C   s
   |  a  d  S(   N(   t   _profile_hook(   t   func(    (    s   /usr/lib/python2.5/threading.pyR   @   s    c         C   s
   |  a  d  S(   N(   t   _trace_hook(   R$   (    (    s   /usr/lib/python2.5/threading.pyR   D   s    c          O   s   t  |  | Ž  S(   N(   t   _RLock(   R   t   kwargs(    (    s   /usr/lib/python2.5/threading.pyR
   L   s    R&   c           B   s\   e  Z d	 d  „ Z d „  Z d d „ Z e Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z RS(
   c         C   s2   t  i |  | ƒ t ƒ  |  _ d  |  _ d |  _ d  S(   Ni    (   R   R   t   _allocate_lockt   _RLock__blockR   t   _RLock__ownert   _RLock__count(   R   R   (    (    s   /usr/lib/python2.5/threading.pyR   Q   s    	c         C   s0   |  i  } d |  i i | o
 | i ƒ  |  i f S(   Ns   <%s(%s, %d)>(   R*   t	   __class__R!   R   R+   (   R   t   owner(    (    s   /usr/lib/python2.5/threading.pyt   __repr__W   s
    		i   c         C   s   t  ƒ  } |  i | j o+ |  i d |  _ |  i d |  | ƒ d Sn |  i i | ƒ } | o) | |  _ d |  _ |  i d |  | ƒ n |  i d |  | ƒ | S(   Ni   s!   %s.acquire(%s): recursive successs   %s.acquire(%s): initial successs   %s.acquire(%s): failure(   R   R*   R+   R    R)   t   acquire(   R   t   blockingt   met   rc(    (    s   /usr/lib/python2.5/threading.pyR/   ^   s    			c         C   s|   |  i  t ƒ  j	 o t d ƒ ‚ n |  i d |  _ } | p* d  |  _  |  i i ƒ  |  i d |  ƒ n |  i d |  ƒ d  S(   Ns   cannot release un-aquired locki   s   %s.release(): final releases   %s.release(): non-final release(   R*   R   t   RuntimeErrorR+   R   R)   t   releaseR    (   R   t   count(    (    s   /usr/lib/python2.5/threading.pyR4   r   s    	c         C   s   |  i  ƒ  d  S(   N(   R4   (   R   t   tt   vt   tb(    (    s   /usr/lib/python2.5/threading.pyt   __exit__   s    c         C   s?   | \ } } |  i  i ƒ  | |  _ | |  _ |  i d |  ƒ d  S(   Ns   %s._acquire_restore()(   R)   R/   R+   R*   R    (   R   t   .1R5   R-   (    (    s   /usr/lib/python2.5/threading.pyt   _acquire_restore„   s
    			c         C   sK   |  i  d |  ƒ |  i } d |  _ |  i } d  |  _ |  i i ƒ  | | f S(   Ns   %s._release_save()i    (   R    R+   R*   R   R)   R4   (   R   R5   R-   (    (    s   /usr/lib/python2.5/threading.pyt   _release_save‹   s    				c         C   s   |  i  t ƒ  j S(   N(   R*   R   (   R   (    (    s   /usr/lib/python2.5/threading.pyt	   _is_owned•   s    N(   R!   R"   R   R   R.   R/   t	   __enter__R4   R9   R;   R<   R=   (    (    (    s   /usr/lib/python2.5/threading.pyR&   O   s   					
c          O   s   t  |  | Ž  S(   N(   t
   _Condition(   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR   ™   s    R?   c           B   sn   e  Z d d d  „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d d „ Z
 d d	 „ Z d
 „  Z RS(   c         C   sÊ   t  i |  | ƒ | d  j o t ƒ  } n | |  _ | i |  _ | i |  _ y | i |  _ Wn t j
 o n Xy | i	 |  _	 Wn t j
 o n Xy | i
 |  _
 Wn t j
 o n Xg  |  _ d  S(   N(   R   R   R   R
   t   _Condition__lockR/   R4   R<   t   AttributeErrorR;   R=   t   _Condition__waiters(   R   t   lockR   (    (    s   /usr/lib/python2.5/threading.pyR   ž   s&    	c         C   s   |  i  i ƒ  S(   N(   R@   R>   (   R   (    (    s   /usr/lib/python2.5/threading.pyR>   ·   s    c         G   s   |  i  i | Œ  S(   N(   R@   R9   (   R   R   (    (    s   /usr/lib/python2.5/threading.pyR9   º   s    c         C   s   d |  i  t |  i ƒ f S(   Ns   <Condition(%s, %d)>(   R@   t   lenRB   (   R   (    (    s   /usr/lib/python2.5/threading.pyR.   ½   s    c         C   s   |  i  i ƒ  d  S(   N(   R@   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyR<   À   s    c         C   s   |  i  i ƒ  d  S(   N(   R@   R/   (   R   t   x(    (    s   /usr/lib/python2.5/threading.pyR;   Ã   s    c         C   s0   |  i  i d ƒ o |  i  i ƒ  t Sn t Sd  S(   Ni    (   R@   R/   R4   t   Falset   True(   R   (    (    s   /usr/lib/python2.5/threading.pyR=   Æ   s    c      	   C   sg  |  i  ƒ  p t d ƒ ‚ n t ƒ  } | i ƒ  |  i i | ƒ |  i ƒ  } z| d  j o | i ƒ  |  i d |  ƒ nØ t	 ƒ  | } d } xf t
 o^ | i d ƒ } | o Pn | t	 ƒ  } | d j o Pn t | d | d ƒ } t | ƒ q W| pA |  i d |  | ƒ y |  i i | ƒ WqQt j
 o qQXn |  i d |  | ƒ Wd  |  i | ƒ Xd  S(	   Ns   cannot wait on un-aquired locks   %s.wait(): got itgü©ñÒMb@?i    i   gš™™™™™©?s   %s.wait(%s): timed outs   %s.wait(%s): got it(   R=   R3   R(   R/   RB   t   appendR<   R   R    t   _timeRG   t   mint   _sleept   removet
   ValueErrorR;   (   R   t   timeoutt   waitert   saved_statet   endtimet   delayt   gotitt	   remaining(    (    s   /usr/lib/python2.5/threading.pyt   waitÏ   s<    	

 	i   c         C   s¿   |  i  ƒ  p t d ƒ ‚ n |  i } | |  } | p |  i d |  ƒ d  Sn |  i d |  | | d j o d p d ƒ x? | D]7 } | i ƒ  y | i | ƒ Wq€ t j
 o q€ Xq€ Wd  S(   Ns    cannot notify on un-aquired locks   %s.notify(): no waiterss"   %s.notify(): notifying %d waiter%si   t   st    (   R=   R3   RB   R    R4   RL   RM   (   R   t   nRB   t   waitersRO   (    (    s   /usr/lib/python2.5/threading.pyt   notifyù   s     	
 
c         C   s   |  i  t |  i ƒ ƒ d  S(   N(   RZ   RD   RB   (   R   (    (    s   /usr/lib/python2.5/threading.pyt	   notifyAll  s    N(   R!   R"   R   R   R>   R9   R.   R<   R;   R=   RU   RZ   R[   (    (    (    s   /usr/lib/python2.5/threading.pyR?   œ   s   							*c          O   s   t  |  | Ž  S(   N(   t
   _Semaphore(   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR     s    R\   c           B   s;   e  Z d  d d „ Z d  d „ Z e Z d „  Z d „  Z RS(   i   c         C   sL   | d j  o t  d ƒ ‚ n t i |  | ƒ t t ƒ  ƒ |  _ | |  _ d  S(   Ni    s$   semaphore initial value must be >= 0(   RM   R   R   R   R	   t   _Semaphore__condt   _Semaphore__value(   R   t   valueR   (    (    s   /usr/lib/python2.5/threading.pyR     s
    c         C   sš   t  } |  i i ƒ  xs |  i d j o6 | p Pn |  i d |  | |  i ƒ |  i i ƒ  q W|  i d |  _ |  i d |  |  i ƒ t } |  i i ƒ  | S(   Ni    s)   %s.acquire(%s): blocked waiting, value=%si   s   %s.acquire: success, value=%s(   RF   R]   R/   R^   R    RU   RG   R4   (   R   R0   R2   (    (    s   /usr/lib/python2.5/threading.pyR/     s     		c         C   sQ   |  i  i ƒ  |  i d |  _ |  i d |  |  i ƒ |  i  i ƒ  |  i  i ƒ  d  S(   Ni   s   %s.release: success, value=%s(   R]   R/   R^   R    RZ   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyR4   2  s    	c         C   s   |  i  ƒ  d  S(   N(   R4   (   R   R6   R7   R8   (    (    s   /usr/lib/python2.5/threading.pyR9   ;  s    N(   R!   R"   R   R   R/   R>   R4   R9   (    (    (    s   /usr/lib/python2.5/threading.pyR\     s
   		c          O   s   t  |  | Ž  S(   N(   t   _BoundedSemaphore(   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR   ?  s    R`   c           B   s&   e  Z d  Z d d d „ Z d „  Z RS(   s6   Semaphore that checks that # releases is <= # acquiresi   c         C   s    t  i |  | | ƒ | |  _ d  S(   N(   R\   R   t   _initial_value(   R   R_   R   (    (    s   /usr/lib/python2.5/threading.pyR   D  s    c         C   s-   |  i  |  i j o t d ‚ n t i |  ƒ S(   Ns!   Semaphore released too many times(   R^   Ra   RM   R\   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyR4   H  s    N(   R!   R"   t   __doc__R   R   R4   (    (    (    s   /usr/lib/python2.5/threading.pyR`   B  s   c          O   s   t  |  | Ž  S(   N(   t   _Event(   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR   N  s    Rc   c           B   s;   e  Z d d  „ Z d „  Z d „  Z d „  Z d d „ Z RS(   c         C   s/   t  i |  | ƒ t t ƒ  ƒ |  _ t |  _ d  S(   N(   R   R   R   R	   t   _Event__condRF   t   _Event__flag(   R   R   (    (    s   /usr/lib/python2.5/threading.pyR   U  s    c         C   s   |  i  S(   N(   Re   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   isSetZ  s    c         C   s<   |  i  i ƒ  z t |  _ |  i  i ƒ  Wd  |  i  i ƒ  Xd  S(   N(   Rd   R/   RG   Re   R[   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   set]  s
    	c         C   s/   |  i  i ƒ  z t |  _ Wd  |  i  i ƒ  Xd  S(   N(   Rd   R/   RF   Re   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   cleare  s    c         C   sD   |  i  i ƒ  z" |  i p |  i  i | ƒ n Wd  |  i  i ƒ  Xd  S(   N(   Rd   R/   Re   RU   R4   (   R   RN   (    (    s   /usr/lib/python2.5/threading.pyRU   l  s
    
N(   R!   R"   R   R   Rf   Rg   Rh   RU   (    (    (    s   /usr/lib/python2.5/threading.pyRc   Q  s
   			i    s	   Thread-%dc         C   s   t  d a  |  t  S(   Ni   (   t   _counter(   t   template(    (    s   /usr/lib/python2.5/threading.pyt   _newnamev  s    
c           B   s³   e  Z e Z e i Z d d d d d d d  „ Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d	 „ Z d
 „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s¾   | d  j p
 t d ‚ t i |  | ƒ | d  j o
 h  } n | |  _ t | p t ƒ  ƒ |  _ | |  _ | |  _	 |  i
 ƒ  |  _ t |  _ t |  _ t t ƒ  ƒ |  _ t |  _ t i |  _ d  S(   Ns#   group argument must be None for now(   R   t   AssertionErrorR   R   t   _Thread__targett   strRk   t   _Thread__namet   _Thread__argst   _Thread__kwargst   _set_daemont   _Thread__daemonicRF   t   _Thread__startedt   _Thread__stoppedR   R	   t   _Thread__blockRG   t   _Thread__initializedR   R   t   _Thread__stderr(   R   t   groupt   targett   nameR   R'   R   (    (    s   /usr/lib/python2.5/threading.pyR   Œ  s    
						c         C   s   t  ƒ  i ƒ  S(   N(   R   t   isDaemon(   R   (    (    s   /usr/lib/python2.5/threading.pyRr   Ÿ  s    c         C   st   |  i  p
 t d ‚ d } |  i o
 d } n |  i o
 d } n |  i o | d } n d |  i i |  i | f S(   Ns    Thread.__init__() was not calledt   initialt   startedt   stoppeds    daemons   <%s(%s, %s)>(   Rw   Rl   Rt   Ru   Rs   R,   R!   Ro   (   R   t   status(    (    s   /usr/lib/python2.5/threading.pyR.   £  s    




c         C   s‰   |  i  p t d ƒ ‚ n |  i o t d ƒ ‚ n |  i d |  ƒ t i ƒ  |  t |  <t i ƒ  t |  i	 d ƒ t
 |  _ t d ƒ d  S(   Ns   thread.__init__() not calleds   thread already starteds   %s.start(): starting threadgíµ ÷Æ°>(    (   Rw   R3   Rt   R    t   _active_limbo_lockR/   t   _limboR4   t   _start_new_threadt   _Thread__bootstrapRG   RK   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   start®  s    




	c         C   s(   |  i  o |  i  |  i |  i Ž  n d  S(   N(   Rm   Rp   Rq   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   run¼  s    
c         C   s>   y |  i  ƒ  Wn) |  i o t d  j o d  Sn ‚  n Xd  S(   N(   t   _Thread__bootstrap_innerRs   R   R   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   __bootstrapÀ  s    c         C   s  zÉt  |  _ t i ƒ  |  t t ƒ  <t |  =t i ƒ  |  i d |  ƒ t	 o! |  i d |  ƒ t
 i t	 ƒ n t o! |  i d |  ƒ t
 i t ƒ n y |  i ƒ  Wnt j
 o |  i d |  ƒ n|  i d |  ƒ t
 o' t
 i i d |  i ƒ  t ƒ  f ƒ qÈ|  i ƒ  \ } } } zŠ |  i d |  i ƒ  d IJ|  i d	 IJxD | o< |  i d
 | i i i | i | i i i f IJ| i } qKW|  i d | | f IJWd  ~ ~ ~ Xn X|  i d |  ƒ Wd  t i ƒ  z& |  i ƒ  y t t ƒ  =Wn n XWd  t i ƒ  XXd  S(   Ns    %s.__bootstrap(): thread starteds(   %s.__bootstrap(): registering trace hooks*   %s.__bootstrap(): registering profile hooks#   %s.__bootstrap(): raised SystemExits%   %s.__bootstrap(): unhandled exceptions   Exception in thread %s:
%s
s   Exception in thread s2    (most likely raised during interpreter shutdown):s"   Traceback (most recent call last):s     File "%s", line %s, in %ss   %s: %ss   %s.__bootstrap(): normal return(   RG   Rt   R   R/   t   _activet
   _get_identR‚   R4   R    R%   R   R   R#   R   R†   t
   SystemExitR   R   R   t   _format_exct   _Thread__exc_infoRx   t   tb_framet   f_codet   co_filenamet	   tb_linenot   co_namet   tb_nextt   _Thread__stop(   R   t   exc_typet	   exc_valuet   exc_tb(    (    s   /usr/lib/python2.5/threading.pyt   __bootstrap_innerÔ  s`    	

 

c         C   s4   |  i  i ƒ  t |  _ |  i  i ƒ  |  i  i ƒ  d  S(   N(   Rv   R/   RG   Ru   R[   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   __stop  s    	c         C   s[   t  i ƒ  z? y t t ƒ  =Wn* t j
 o d t i j o ‚  qH n XWd t  i ƒ  Xd S(   sA   Remove current thread from the dict of currently running threads.t   dummy_threadingN(   R   R/   R‰   RŠ   t   KeyErrorR   t   modulesR4   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   __delete!  s    
c         C   sF  |  i  p t d ƒ ‚ n |  i p t d ƒ ‚ n |  t ƒ  j o t d ƒ ‚ n |  i p |  i d |  ƒ n |  i i ƒ  z² | d  j o3 x |  i p |  i i	 ƒ  q’ W|  i d |  ƒ no t
 ƒ  | } x^ |  i pC | t
 ƒ  } | d j o |  i d |  ƒ Pn |  i i	 | ƒ qÒ W|  i d |  ƒ Wd  |  i i ƒ  Xd  S(   Ns   Thread.__init__() not calleds'   cannot join thread before it is starteds   cannot join current threads%   %s.join(): waiting until thread stopss   %s.join(): thread stoppedi    s   %s.join(): timed out(   Rw   R3   Rt   R   Ru   R    Rv   R/   R   RU   RI   R4   (   R   RN   t   deadlineRR   (    (    s   /usr/lib/python2.5/threading.pyt   joinC  s2    


 
 
c         C   s   |  i  p
 t d ‚ |  i S(   Ns   Thread.__init__() not called(   Rw   Rl   Ro   (   R   (    (    s   /usr/lib/python2.5/threading.pyR   d  s    c         C   s'   |  i  p
 t d ‚ t | ƒ |  _ d  S(   Ns   Thread.__init__() not called(   Rw   Rl   Rn   Ro   (   R   R{   (    (    s   /usr/lib/python2.5/threading.pyt   setNameh  s    c         C   s&   |  i  p
 t d ‚ |  i o |  i S(   Ns   Thread.__init__() not called(   Rw   Rl   Rt   Ru   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   isAlivel  s    c         C   s   |  i  p
 t d ‚ |  i S(   Ns   Thread.__init__() not called(   Rw   Rl   Rs   (   R   (    (    s   /usr/lib/python2.5/threading.pyR|   p  s    c         C   sA   |  i  p t d ƒ ‚ n |  i o t d ƒ ‚ n | |  _ d  S(   Ns   Thread.__init__() not calleds)   cannot set daemon status of active thread(   Rw   R3   Rt   Rs   (   R   t   daemonic(    (    s   /usr/lib/python2.5/threading.pyt	   setDaemont  s
    

N(    (   R!   R"   RF   Rw   R   t   exc_infoR   R   R   Rr   R.   R…   R†   R„   R‡   R”   t   _Thread__deleteRŸ   R   R    R¡   R|   R£   (    (    (    s   /usr/lib/python2.5/threading.pyR   ƒ  s$   								G		"!				c          O   s   t  |  | Ž  S(   N(   t   _Timer(   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR   }  s    R¦   c           B   s/   e  Z d  Z g  h  d „ Z d „  Z d „  Z RS(   s²   Call a function after a specified number of seconds:

    t = Timer(30.0, f, args=[], kwargs={})
    t.start()
    t.cancel() # stop the timer's action if it's still waiting
    c         C   sA   t  i |  ƒ | |  _ | |  _ | |  _ | |  _ t ƒ  |  _ d  S(   N(   R   R   t   intervalt   functionR   R'   R   t   finished(   R   R§   R¨   R   R'   (    (    s   /usr/lib/python2.5/threading.pyR   ˆ  s    				c         C   s   |  i  i ƒ  d S(   s(   Stop the timer if it hasn't finished yetN(   R©   Rg   (   R   (    (    s   /usr/lib/python2.5/threading.pyt   cancel  s    c         C   sN   |  i  i |  i ƒ |  i  i ƒ  p |  i |  i |  i Ž  n |  i  i ƒ  d  S(   N(   R©   RU   R§   Rf   R¨   R   R'   Rg   (   R   (    (    s   /usr/lib/python2.5/threading.pyR†   ”  s    (   R!   R"   Rb   R   Rª   R†   (    (    (    s   /usr/lib/python2.5/threading.pyR¦   €  s   	t   _MainThreadc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   sA   t  i |  d d ƒt |  _ t i ƒ  |  t t ƒ  <t i ƒ  d  S(   NR{   t
   MainThread(	   R   R   RG   Rt   R   R/   R‰   RŠ   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyR   Ÿ  s
    	
c         C   s   t  S(   N(   RF   (   R   (    (    s   /usr/lib/python2.5/threading.pyRr   ¦  s    c         C   sn   |  i  ƒ  t ƒ  } | o |  i d |  ƒ n x | o | i ƒ  t ƒ  } q1 W|  i d |  ƒ |  i ƒ  d  S(   Ns   %s: waiting for other threadss   %s: exiting(   R”   t   _pickSomeNonDaemonThreadR    RŸ   R¥   (   R   R6   (    (    s   /usr/lib/python2.5/threading.pyt	   _exitfunc©  s    
	 
(   R!   R"   R   Rr   R®   (    (    (    s   /usr/lib/python2.5/threading.pyR«     s   		c          C   s;   x4 t  ƒ  D]) }  |  i ƒ  o |  i ƒ  o |  Sq
 q
 Wd  S(   N(   R   R|   R¡   R   (   R6   (    (    s   /usr/lib/python2.5/threading.pyR­   ¶  s
    
 t   _DummyThreadc           B   s&   e  Z d  „  Z d „  Z d d „ Z RS(   c         C   sM   t  i |  d t d ƒ ƒ|  ` t |  _ t i ƒ  |  t t	 ƒ  <t i
 ƒ  d  S(   NR{   s   Dummy-%d(   R   R   Rk   Rv   RG   Rt   R   R/   R‰   RŠ   R4   (   R   (    (    s   /usr/lib/python2.5/threading.pyR   Ç  s    	
c         C   s   t  S(   N(   RG   (   R   (    (    s   /usr/lib/python2.5/threading.pyRr   Ô  s    c         C   s   t  p
 t d ‚ d  S(   Ns   cannot join a dummy thread(   RF   Rl   (   R   RN   (    (    s   /usr/lib/python2.5/threading.pyRŸ   ×  s    N(   R!   R"   R   Rr   R   RŸ   (    (    (    s   /usr/lib/python2.5/threading.pyR¯   Å  s   		c           C   s0   y t  t ƒ  SWn t j
 o t ƒ  Sn Xd  S(   N(   R‰   RŠ   R›   R¯   (    (    (    s   /usr/lib/python2.5/threading.pyR   Ý  s    c          C   s.   t  i ƒ  t t ƒ t t ƒ }  t  i ƒ  |  S(   N(   R   R/   RD   R‰   R‚   R4   (   R5   (    (    s   /usr/lib/python2.5/threading.pyR   ä  s    

c          C   s.   t  i ƒ  t i ƒ  t i ƒ  }  t  i ƒ  |  S(   N(   R   R/   R‰   t   valuesR‚   R4   (   t   active(    (    s   /usr/lib/python2.5/threading.pyR   ê  s    

(   R   (   t   _local(   R   c          C   s  d t  f d „  ƒ  Y}  d t f d „  ƒ  Y} d t f d „  ƒ  Y} d } d } d	 } |  | ƒ } g  } xE t | ƒ D]7 } | | | ƒ }	 |	 i d
 | d ƒ | i |	 ƒ qs W| | | | ƒ }
 x" | D] }	 |	 i ƒ  t d ƒ qÈ W|
 i ƒ  x | D] }	 |	 i ƒ  q÷ W|
 i ƒ  d  S(   Nt   BoundedQueuec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         S   sV   t  i |  ƒ t ƒ  |  _ t |  i ƒ |  _ t |  i ƒ |  _ | |  _ t ƒ  |  _	 d  S(   N(
   R   R   R
   t   monR   R2   t   wct   limitR   t   queue(   R   R¶   (    (    s   /usr/lib/python2.5/threading.pyR     s    	c         S   s•   |  i  i ƒ  x; t |  i ƒ |  i j o! |  i d | ƒ |  i i ƒ  q W|  i i | ƒ |  i d | t |  i ƒ ƒ |  i	 i
 ƒ  |  i  i ƒ  d  S(   Ns   put(%s): queue fulls    put(%s): appended, length now %d(   R´   R/   RD   R·   R¶   R    Rµ   RU   RH   R2   RZ   R4   (   R   t   item(    (    s   /usr/lib/python2.5/threading.pyt   put  s     	c         S   s‚   |  i  i ƒ  x) |  i p |  i d ƒ |  i i ƒ  q W|  i i ƒ  } |  i d | t |  i ƒ ƒ |  i i	 ƒ  |  i  i
 ƒ  | S(   Ns   get(): queue emptys   get(): got %s, %d left(   R´   R/   R·   R    R2   RU   t   popleftRD   Rµ   RZ   R4   (   R   R¸   (    (    s   /usr/lib/python2.5/threading.pyt   get  s     
(   R!   R"   R   R¹   R»   (    (    (    s   /usr/lib/python2.5/threading.pyR³     s   		t   ProducerThreadc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s)   t  i |  d d ƒ| |  _ | |  _ d  S(   NR{   t   Producer(   R   R   R·   t   quota(   R   R·   R¾   (    (    s   /usr/lib/python2.5/threading.pyR   '  s    	c         S   sm   d d k  l  } d } xP | |  i j  o? | d } |  i i d |  i ƒ  | f ƒ t | ƒ  d ƒ q Wd  S(   Niÿÿÿÿ(   t   randomi    i   s   %s.%dgñhãˆµøä>(   R¿   R¾   R·   R¹   R   RK   (   R   R¿   t   counter(    (    s   /usr/lib/python2.5/threading.pyR†   ,  s     
 (   R!   R"   R   R†   (    (    (    s   /usr/lib/python2.5/threading.pyR¼   %  s   	t   ConsumerThreadc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s)   t  i |  d d ƒ| |  _ | |  _ d  S(   NR{   t   Consumer(   R   R   R·   R5   (   R   R·   R5   (    (    s   /usr/lib/python2.5/threading.pyR   7  s    	c         S   s@   x9 |  i  d j o( |  i i ƒ  } | GH|  i  d |  _  q Wd  S(   Ni    i   (   R5   R·   R»   (   R   R¸   (    (    s   /usr/lib/python2.5/threading.pyR†   <  s
     (   R!   R"   R   R†   (    (    (    s   /usr/lib/python2.5/threading.pyRÁ   5  s   	i   i   i   s   Producer-%di   gíµ ÷Æ°>(   R   R   t   rangeR    RH   R…   RK   RŸ   (   R³   R¼   RÁ   t   NPt   QLt   NIt   Qt   Pt   iR6   t   C(    (    s   /usr/lib/python2.5/threading.pyt   _test  s.       

 t   __main__(B   Rb   t   sysR   t   threadt   ImportErrorRœ   R!   R    RI   R   RK   t	   tracebackR   RŒ   t   collectionsR   t   __all__t   start_new_threadRƒ   t   allocate_lockR(   t	   get_identRŠ   t   errort   ThreadErrorRF   R   t   objectR   R   R#   R%   R   R   R	   R
   R&   R   R?   R   R\   R   R`   R   Rc   Ri   Rk   R   R‰   R‚   R   R   R¦   R«   R­   R¯   R   R   R   R   R®   t	   _shutdownR²   R   t   _threading_localRË   (    (    (    s   /usr/lib/python2.5/threading.pys   <module>   sr   
								J	s	-		$	ú						R