Your IP : 3.144.21.237


Current Path : /opt/alt/python27/lib64/python2.7/
Upload File :
Current File : //opt/alt/python27/lib64/python2.7/threading.pyo

�
^
bc@s=dZddlZyddlZWnek
rBeje=�nXddlZddlm	Z
ddlmZ
ddlmZmZddlmZddd	d
ddd
ddddddddddgZejZejZejZejZ[ejddedddd�e Z!de"fd��YZ#e$a%e$a&d �Z'd!�Z(eZ)d"�Z*d#e#fd$��YZ+d%�Z,d&e#fd'��YZ-d(�Z.d)e#fd*��YZ/d+�Z0d,e/fd-��YZ1d.�Z2d/e#fd0��YZ3e
�j4Z5e5�d1d2�Z6e�a7iZ8iZ9de#fd3��YZ:d4�Z;d5e:fd6��YZ<d7e:fd8��YZ=d9�Z>d:e:fd;��YZ?d<�Z@e@ZAd=�ZBeBZCd>�ZDd?�ZEdd@lmFZFe=�jGZHyddAlmIZJWn!ek
rddBlKmJZJnXdC�ZLdD�ZMedEkr9eM�ndS(Fs;Thread module emulating a subset of Java's threading model.i����N(tdeque(tcount(ttimetsleep(t
format_exctactiveCounttactive_countt	Conditiont
currentThreadtcurrent_threadt	enumeratetEventtLocktRLockt	SemaphoretBoundedSemaphoretThreadtTimert
setprofiletsettracetlocalt
stack_sizetignoretcategorytmodulet	threadingtmessages
sys.exc_cleart_VerbosecBseZdd�Zd�ZRS(cCsdS(N((tselftverbose((s./opt/alt/python27/lib64/python2.7/threading.pyt__init__PscGsdS(N((Rtargs((s./opt/alt/python27/lib64/python2.7/threading.pyt_noteRsN(t__name__t
__module__tNoneRR (((s./opt/alt/python27/lib64/python2.7/threading.pyROscCs
|adS(s�Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    N(t
_profile_hook(tfunc((s./opt/alt/python27/lib64/python2.7/threading.pyRZscCs
|adS(s�Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    N(t_trace_hook(R%((s./opt/alt/python27/lib64/python2.7/threading.pyRdscOs
t||�S(s2Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    (t_RLock(Rtkwargs((s./opt/alt/python27/lib64/python2.7/threading.pyR
rs	R'cBsbeZdZd
d�Zd�Zdd�ZeZd�Zd�Z	d�Z
d�Zd	�ZRS(sA reentrant lock must be released by the thread that acquired it. Once a
       thread has acquired a reentrant lock, the same thread may acquire it
       again without blocking; the thread must release it once for each time it
       has acquired it.
    cCs2tj||�t�|_d|_d|_dS(Ni(RRt_allocate_lockt
_RLock__blockR#t
_RLock__ownert
_RLock__count(RR((s./opt/alt/python27/lib64/python2.7/threading.pyR�s	cCsH|j}yt|j}Wntk
r-nXd|jj||jfS(Ns<%s owner=%r count=%d>(R+t_activetnametKeyErrort	__class__R!R,(Rtowner((s./opt/alt/python27/lib64/python2.7/threading.pyt__repr__�s	
icCs]t�}|j|kr,|jd|_dS|jj|�}|rY||_d|_n|S(s�Acquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        i(t
_get_identR+R,R*tacquire(Rtblockingtmetrc((s./opt/alt/python27/lib64/python2.7/threading.pyR4�s			cCsX|jt�kr!td��n|jd|_}|sTd|_|jj�ndS(smRelease a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        scannot release un-acquired lockiN(R+R3tRuntimeErrorR,R#R*trelease(RR((s./opt/alt/python27/lib64/python2.7/threading.pyR9�s	
cCs|j�dS(N(R9(Rtttvttb((s./opt/alt/python27/lib64/python2.7/threading.pyt__exit__�scCs/|\}}|jj�||_||_dS(N(R*R4R,R+(Rtcount_ownerRR1((s./opt/alt/python27/lib64/python2.7/threading.pyt_acquire_restore�s

		cCs;|j}d|_|j}d|_|jj�||fS(Ni(R,R+R#R*R9(RRR1((s./opt/alt/python27/lib64/python2.7/threading.pyt
_release_save�s				
cCs|jt�kS(N(R+R3(R((s./opt/alt/python27/lib64/python2.7/threading.pyt	_is_owned�sN(
R!R"t__doc__R#RR2R4t	__enter__R9R=R?R@RA(((s./opt/alt/python27/lib64/python2.7/threading.pyR'}s		&				
cOs
t||�S(s}Factory function that returns a new condition variable object.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    (t
_Condition(RR(((s./opt/alt/python27/lib64/python2.7/threading.pyR�sRDcBs}eZdZddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ded�Zd	d
�Z
d�ZeZRS(
slCondition variables allow one or more threads to wait until they are
       notified by another thread.
    cCs�tj||�|dkr(t�}n||_|j|_|j|_y|j|_Wntk
rlnXy|j	|_	Wntk
r�nXy|j
|_
Wntk
r�nXg|_dS(N(RRR#R
t_Condition__lockR4R9R@tAttributeErrorR?RAt_Condition__waiters(RtlockR((s./opt/alt/python27/lib64/python2.7/threading.pyRs&	


cCs
|jj�S(N(RERC(R((s./opt/alt/python27/lib64/python2.7/threading.pyRCscGs|jj|�S(N(RER=(RR((s./opt/alt/python27/lib64/python2.7/threading.pyR= scCsd|jt|j�fS(Ns<Condition(%s, %d)>(REtlenRG(R((s./opt/alt/python27/lib64/python2.7/threading.pyR2#scCs|jj�dS(N(RER9(R((s./opt/alt/python27/lib64/python2.7/threading.pyR@&scCs|jj�dS(N(RER4(Rtx((s./opt/alt/python27/lib64/python2.7/threading.pyR?)scCs+|jjd�r#|jj�tStSdS(Ni(RER4R9tFalsetTrue(R((s./opt/alt/python27/lib64/python2.7/threading.pyRA,s
c	Cs2|j�std��nt�}|j�|jj|�|j�}z�|dkrf|j�n�t�|}d}xot	r�|jd�}|r�Pn|t�}|dkr�Pn|r�t
|d|d�}n|}t|�q|W|sy|jj|�Wqt
k
rqXnWd|j|�XdS(sjWait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notifyAll() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        scannot wait on un-acquired lockg����Mb@?iig�������?N(RAR8R)R4RGtappendR@R#t_timeRLtmint_sleeptremovet
ValueErrorR?(	Rttimeoutt	balancingtwaitertsaved_statetendtimetdelaytgotitt	remaining((s./opt/alt/python27/lib64/python2.7/threading.pytwait5s<	


	

icCs�|j�std��n|j}|| }|s8dS|jd|||dkrYdp\d�x=|D]5}|j�y|j|�Wqgtk
r�qgXqgWdS(sKWake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        s!cannot notify on un-acquired lockNs"%s.notify(): notifying %d waiter%sitst(RAR8RGR R9RQRR(RtnRGtwaitersRU((s./opt/alt/python27/lib64/python2.7/threading.pytnotifyxs
	



cCs|jt|j��dS(s�Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        N(R`RIRG(R((s./opt/alt/python27/lib64/python2.7/threading.pyt	notifyAll�sN(R!R"RBR#RRCR=R2R@R?RARLR[R`Rat
notify_all(((s./opt/alt/python27/lib64/python2.7/threading.pyRD�s							C		cOs
t||�S(sOA factory function that returns a new semaphore.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    (t
_Semaphore(RR(((s./opt/alt/python27/lib64/python2.7/threading.pyR�s	RccBsAeZdZddd�Zdd�ZeZd�Zd�ZRS(s"Semaphores manage a counter representing the number of release() calls
       minus the number of acquire() calls, plus an initial value. The acquire()
       method blocks if necessary until it can return without making the counter
       negative. If not given, value defaults to 1.

    icCsJ|dkrtd��ntj||�tt��|_||_dS(Nis$semaphore initial value must be >= 0(RRRRRRt_Semaphore__condt_Semaphore__value(RtvalueR((s./opt/alt/python27/lib64/python2.7/threading.pyR�s
cCs]t}|j�Hx@|jdkr<|s,Pn|jj�qW|jd|_t}WdQX|S(sAcquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        iiN(RKRdReR[RL(RR5R7((s./opt/alt/python27/lib64/python2.7/threading.pyR4�s
cCs1|j�"|jd|_|jj�WdQXdS(s�Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        iN(RdReR`(R((s./opt/alt/python27/lib64/python2.7/threading.pyR9�s
cCs|j�dS(N(R9(RR:R;R<((s./opt/alt/python27/lib64/python2.7/threading.pyR=�sN(	R!R"RBR#RR4RCR9R=(((s./opt/alt/python27/lib64/python2.7/threading.pyRc�s%	cOs
t||�S(s�A factory function that returns a new bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    (t_BoundedSemaphore(RR(((s./opt/alt/python27/lib64/python2.7/threading.pyR�sRgcBs&eZdZddd�Zd�ZRS(s�A bounded semaphore checks to make sure its current value doesn't exceed
       its initial value. If it does, ValueError is raised. In most situations
       semaphores are used to guard resources with limited capacity.
    icCs tj|||�||_dS(N(RcRt_initial_value(RRfR((s./opt/alt/python27/lib64/python2.7/threading.pyRscCsQ|j�B|j|jkr+td��n|jd7_|jj�WdQXdS(s6Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        s!Semaphore released too many timesiN(RdReRhRRR`(R((s./opt/alt/python27/lib64/python2.7/threading.pyR9s


N(R!R"RBR#RR9(((s./opt/alt/python27/lib64/python2.7/threading.pyRgscOs
t||�S(s�A factory function that returns a new event.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.

    (t_Event(RR(((s./opt/alt/python27/lib64/python2.7/threading.pyR!sRicBsPeZdZdd�Zd�Zd�ZeZd�Zd�Z	dd�Z
RS(s�A factory function that returns a new event object. An event manages a
       flag that can be set to true with the set() method and reset to false
       with the clear() method. The wait() method blocks until the flag is true.

    cCs/tj||�tt��|_t|_dS(N(RRRRt_Event__condRKt_Event__flag(RR((s./opt/alt/python27/lib64/python2.7/threading.pyR4scCs|jjt��dS(N(RjRR(R((s./opt/alt/python27/lib64/python2.7/threading.pyt_reset_internal_locks9scCs|jS(s5Return true if and only if the internal flag is true.(Rk(R((s./opt/alt/python27/lib64/python2.7/threading.pytisSet=scCs*|j�t|_|jj�WdQXdS(s�Set the internal flag to true.

        All threads waiting for the flag to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        N(RjRLRkRb(R((s./opt/alt/python27/lib64/python2.7/threading.pytsetCs
	cCs|j�t|_WdQXdS(s�Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        N(RjRKRk(R((s./opt/alt/python27/lib64/python2.7/threading.pytclearNs
cCs7|j�(|js&|jj|�n|jSWdQXdS(sHBlock until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        N(RjRkR[(RRS((s./opt/alt/python27/lib64/python2.7/threading.pyR[Xs
	N(R!R"RBR#RRlRmtis_setRnRoR[(((s./opt/alt/python27/lib64/python2.7/threading.pyRi+s				
s	Thread-%dcCs|t�S(N(t_counter(ttemplate((s./opt/alt/python27/lib64/python2.7/threading.pyt_newnameoscBs=eZdZeZejZejZ	ddddddd�Zd�Ze
d��Zd�Zd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zded
�Ze
d��Zejd��Ze
d��Zd�ZeZe
d��Zejd��Zd�Z d�Z!d�Z"d�Z#RS(sqA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion.

    cCs�tj||�|dkr%i}n||_t|p=t��|_||_||_|j	�|_
d|_t�|_
t|_tt��|_t|_tj|_dS(sCThis constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

N(RRR#t_Thread__targettstrRst
_Thread__namet
_Thread__argst_Thread__kwargst_set_daemont_Thread__daemonict_Thread__identRt_Thread__startedRKt_Thread__stoppedRRt_Thread__blockRLt_Thread__initializedt_syststderrt_Thread__stderr(RtgroupttargetR.RR(R((s./opt/alt/python27/lib64/python2.7/threading.pyR�s							cCs0t|d�r|jj�n|jj�dS(NR~(thasattrR~RR|Rl(R((s./opt/alt/python27/lib64/python2.7/threading.pyRl�scCs|jS(N(R~(R((s./opt/alt/python27/lib64/python2.7/threading.pyt_block�scCs
t�jS(N(R	tdaemon(R((s./opt/alt/python27/lib64/python2.7/threading.pyRy�scCs�d}|jj�rd}n|jr0d}n|jrF|d7}n|jdk	ri|d|j7}nd|jj|j|fS(Ntinitialtstartedtstoppeds daemons %ss<%s(%s, %s)>(	R|RpR}RzR{R#R0R!Rv(Rtstatus((s./opt/alt/python27/lib64/python2.7/threading.pyR2�s				
cCs�|jstd��n|jj�r6td��nt�|t|<WdQXyt|jd�Wn(tk
r�t�t|=WdQX�nX|jj	�dS(s-Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        sthread.__init__() not calleds threads can only be started onceN((
RR8R|Rpt_active_limbo_lockt_limbot_start_new_threadt_Thread__bootstrapt	ExceptionR[(R((s./opt/alt/python27/lib64/python2.7/threading.pytstart�s
	

cCs@z&|jr%|j|j|j�nWd|`|`|`XdS(sXMethod representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        N(RtRwRx(R((s./opt/alt/python27/lib64/python2.7/threading.pytrun�s		cCs8y|j�Wn#|jr-tdkr-dS�nXdS(N(t_Thread__bootstrap_innerRzR�R#(R((s./opt/alt/python27/lib64/python2.7/threading.pyt__bootstrap�s
cCst�|_dS(N(R3R{(R((s./opt/alt/python27/lib64/python2.7/threading.pyt
_set_identsc
Cs�z�|j�|jj�t�|t|j<t|=WdQXtra|jd|�t	j
t�ntr�|jd|�t	jt�nzy|j
�Wntk
r�n�t	r�t	jdk	r�t	jd|jt�fIJq�|jdk	r�|j�\}}}z�|jd|jdIJ|jdIJxB|rs|jd|jjj|j|jjjfIJ|j}q2W|jd||fIJWd~~~Xq�nXWd|j�XWdt�'|j�ytt�=WnnXWdQXXdS(	Ns(%s.__bootstrap(): registering trace hooks*%s.__bootstrap(): registering profile hooksException in thread %s:
%ssException in thread s2 (most likely raised during interpreter shutdown):s"Traceback (most recent call last):s  File "%s", line %s, in %ss%s: %s(R�R|RnR�R-R{R�R&R R�RR$RR�t
SystemExitR�R#R.t_format_excR�t_Thread__exc_infottb_frametf_codetco_filenamet	tb_linenotco_namettb_nextt_Thread__exc_cleart
_Thread__stopR3(Rtexc_typet	exc_valuetexc_tb((s./opt/alt/python27/lib64/python2.7/threading.pyt__bootstrap_inners\






	

cCsGt|d�sdS|jj�t|_|jj�|jj�dS(NR~(R�R~R4RLR}RbR9(R((s./opt/alt/python27/lib64/python2.7/threading.pyt__stop\s
	
cCsHyt�tt�=WdQXWn&tk
rCdtjkrD�qDnXdS(sARemove current thread from the dict of currently running threads.Ntdummy_threading(R�R-R3R/R�tmodules(R((s./opt/alt/python27/lib64/python2.7/threading.pyt__deletefs
cCs�|jstd��n|jj�s6td��n|t�krTtd��n|jj�z}|dkr�xj|js�|jj	�qsWnMt
�|}x=|js�|t
�}|dkr�Pn|jj	||�q�WWd|jj�XdS(sWait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        isAlive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        sThread.__init__() not calleds'cannot join thread before it is startedscannot join current threadiN(RR8R|RpR	R~R4R#R}R[RNR9(RRSRTtdeadlineRX((s./opt/alt/python27/lib64/python2.7/threading.pytjoin�s(	


cCs|jS(s�A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        (Rv(R((s./opt/alt/python27/lib64/python2.7/threading.pyR.�s	cCst|�|_dS(N(RuRv(RR.((s./opt/alt/python27/lib64/python2.7/threading.pyR.�scCs|jS(s;Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the thread.get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        (R{(R((s./opt/alt/python27/lib64/python2.7/threading.pytident�s
cCs|jj�o|jS(s�Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        (R|RpR}(R((s./opt/alt/python27/lib64/python2.7/threading.pytisAlive�s	cCs|jS(s�A boolean value indicating whether this thread is a daemon thread (True) or not (False).

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        (Rz(R((s./opt/alt/python27/lib64/python2.7/threading.pyR��s
cCsC|jstd��n|jj�r6td��n||_dS(NsThread.__init__() not calleds)cannot set daemon status of active thread(RR8R|RpRz(Rtdaemonic((s./opt/alt/python27/lib64/python2.7/threading.pyR��s
	cCs|jS(N(R�(R((s./opt/alt/python27/lib64/python2.7/threading.pytisDaemonscCs
||_dS(N(R�(RR�((s./opt/alt/python27/lib64/python2.7/threading.pyt	setDaemonscCs|jS(N(R.(R((s./opt/alt/python27/lib64/python2.7/threading.pytgetNamescCs
||_dS(N(R.(RR.((s./opt/alt/python27/lib64/python2.7/threading.pytsetName
sN(($R!R"RBRKRR�texc_infoR�t	exc_clearR�R#RRltpropertyR�RyR2R�R�R�R�R�R�t_Thread__deleteRLR�R.tsetterR�R�tis_aliveR�R�R�R�R�(((s./opt/alt/python27/lib64/python2.7/threading.pyRzs:			(			
					J	
	#8				cOs
t||�S(s�Factory function to create a Timer object.

    Timers 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

    (t_Timer(RR(((s./opt/alt/python27/lib64/python2.7/threading.pyRs
R�cBs/eZdZgid�Zd�Zd�ZRS(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

    cCsAtj|�||_||_||_||_t�|_dS(N(RRtintervaltfunctionRR(Rtfinished(RR�R�RR(((s./opt/alt/python27/lib64/python2.7/threading.pyR$s
				cCs|jj�dS(s(Stop the timer if it hasn't finished yetN(R�Rn(R((s./opt/alt/python27/lib64/python2.7/threading.pytcancel,scCsL|jj|j�|jj�s;|j|j|j�n|jj�dS(N(R�R[R�RpR�RR(Rn(R((s./opt/alt/python27/lib64/python2.7/threading.pyR�0s(R!R"RBRR�R�(((s./opt/alt/python27/lib64/python2.7/threading.pyR�s	t_MainThreadcBs#eZd�Zd�Zd�ZRS(cCsHtj|dd�|jj�|j�t�|tt�<WdQXdS(NR.t
MainThread(RRR|RnR�R�R-R3(R((s./opt/alt/python27/lib64/python2.7/threading.pyR;s


cCstS(N(RK(R((s./opt/alt/python27/lib64/python2.7/threading.pyRyBscCsJ|j�t�}|rnx|r;|j�t�}qW|j�dS(N(R�t_pickSomeNonDaemonThreadR�R�(RR:((s./opt/alt/python27/lib64/python2.7/threading.pyt	_exitfuncEs
		

(R!R"RRyR�(((s./opt/alt/python27/lib64/python2.7/threading.pyR�9s		cCs2x+t�D] }|jr
|j�r
|Sq
WdS(N(R
R�R�R#(R:((s./opt/alt/python27/lib64/python2.7/threading.pyR�Rst_DummyThreadcBs)eZd�Zd�Zded�ZRS(cCsTtj|dtd��|`|jj�|j�t�|tt	�<WdQXdS(NR.sDummy-%d(
RRRsR~R|RnR�R�R-R3(R((s./opt/alt/python27/lib64/python2.7/threading.pyRcs

cCstS(N(RL(R((s./opt/alt/python27/lib64/python2.7/threading.pyRypscCsdS(N((RRSRT((s./opt/alt/python27/lib64/python2.7/threading.pyR�ssN(R!R"RRyR#RLR�(((s./opt/alt/python27/lib64/python2.7/threading.pyR�as	
	cCs+ytt�SWntk
r&t�SXdS(s�Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    N(R-R3R/R�(((s./opt/alt/python27/lib64/python2.7/threading.pyRys
cCs%t�tt�tt�SWdQXdS(s�Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    N(R�RIR-R�(((s./opt/alt/python27/lib64/python2.7/threading.pyR�scCstj�tj�S(N(R-tvaluesR�(((s./opt/alt/python27/lib64/python2.7/threading.pyt
_enumerate�scCs%t�tj�tj�SWdQXdS(s�Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    N(R�R-R�R�(((s./opt/alt/python27/lib64/python2.7/threading.pyR
�s(R(t_local(RcCs�t�ai}t�}t��xbt�D]W}t|d�rK|j�n||krvt�}||_|||<q)|j�q)Wt	j
�tj
�tj|�WdQXdS(NRl(
R)R�R	R�R�RlR3R{R�R�RoR-tupdate(t
new_activetcurrenttthreadR�((s./opt/alt/python27/lib64/python2.7/threading.pyt_after_fork�s 		
		



cCsdtfd��Y}dtfd��Y}dtfd��Y}d}d}d	}||�}g}xAt|�D]3}|||�}	d
|d|	_|j|	�qsW||||�}
x"|D]}	|	j�td�q�W|
j�x|D]}	|	j�q�W|
j�dS(
NtBoundedQueuecBs#eZd�Zd�Zd�ZRS(cSsVtj|�t�|_t|j�|_t|j�|_||_t�|_	dS(N(
RRR
tmonRR7twctlimitt_dequetqueue(RR�((s./opt/alt/python27/lib64/python2.7/threading.pyR�s
	cSs�|jj�x9t|j�|jkrH|jd|�|jj�qW|jj|�|jd|t|j��|j	j
�|jj�dS(Nsput(%s): queue fulls put(%s): appended, length now %d(R�R4RIR�R�R R�R[RMR7R`R9(Rtitem((s./opt/alt/python27/lib64/python2.7/threading.pytput�s
	
cSs�|jj�x'|js6|jd�|jj�qW|jj�}|jd|t|j��|jj	�|jj
�|S(Nsget(): queue emptysget(): got %s, %d left(R�R4R�R R7R[tpopleftRIR�R`R9(RR�((s./opt/alt/python27/lib64/python2.7/threading.pytget�s



(R!R"RR�R�(((s./opt/alt/python27/lib64/python2.7/threading.pyR��s		tProducerThreadcBseZd�Zd�ZRS(cSs)tj|dd�||_||_dS(NR.tProducer(RRR�tquota(RR�R�((s./opt/alt/python27/lib64/python2.7/threading.pyR�s	cSshddlm}d}xK||jkrc|d}|jjd|j|f�t|�d�qWdS(Ni����(trandomiis%s.%dg�h㈵��>(R�R�R�R�R.RP(RR�tcounter((s./opt/alt/python27/lib64/python2.7/threading.pyR�s
(R!R"RR�(((s./opt/alt/python27/lib64/python2.7/threading.pyR��s	tConsumerThreadcBseZd�Zd�ZRS(cSs)tj|dd�||_||_dS(NR.tConsumer(RRR�R(RR�R((s./opt/alt/python27/lib64/python2.7/threading.pyR
s	cSs>x7|jdkr9|jj�}|GH|jd|_qWdS(Nii(RR�R�(RR�((s./opt/alt/python27/lib64/python2.7/threading.pyR�s(R!R"RR�(((s./opt/alt/python27/lib64/python2.7/threading.pyR�s	iiisProducer-%dig���ư>(RRtrangeR.RMR�RPR�(R�R�R�tNPtQLtNItQtPtiR:tC((s./opt/alt/python27/lib64/python2.7/threading.pyt_test�s( 




t__main__(NRBtsysR�R�tImportErrorR�R!twarningstcollectionsRR�t	itertoolsRt_countRRNRRPt	tracebackRR�t__all__tstart_new_threadR�t
allocate_lockR)t	get_identR3terrortThreadErrortfilterwarningstDeprecationWarningRKt_VERBOSEtobjectRR#R$R&RRRR
R'RRDRRcRRgRRitnextRqRsR�R-R�RRR�R�R�R�RR	RRR�R
RR�t	_shutdownR�Rt_threading_localR�R�(((s./opt/alt/python27/lib64/python2.7/threading.pyt<module>s�

					
	
		u	
�	J		
B	��			
	
		
	%	R

?>