Spade
Mini Shell
�
q�fc@s dZddlZyddlZWnek
rBeje=�nXddlZddlm Z
ddlmZm
ZddlmZdddd d
ddd
dddddddddgZejZejZejZejZ[ejddedddd�eZdefd��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*�Z-d+e,fd,��YZ.d-�Z/d.e
fd/��YZ0d0a1d1d2�Z2e�a3iZ4iZ5de
fd3��YZ6d4�Z7d5e6fd6��YZ8d7e6fd8��YZ9d9�Z:d:e6fd;��YZ;d<�Z<e<Z=d=�Z>e>Z?d>�Z@d?�ZAdd@lmBZBe9�jCZDyddAlmEZFWn!ek
r�ddBlGmFZFnXdC�ZHdD�ZIedEkreI�ndS(Fs;Thread module
emulating a subset of Java's threading
model.i����N(tdeque(ttimetsleep(t
format_exctactiveCounttactive_countt Conditiont
currentThreadtcurrent_threadt enumeratetEventtLocktRLockt SemaphoretBoundedSemaphoretThreadtTimert
setprofiletsettracetlocalt
stack_sizetignoretcategorytmodulet threadingtmessages
sys.exc_cleart_VerbosecBseZdd�Zd�ZRS(cCs"|dkrt}n||_dS(N(tNonet_VERBOSEt_Verbose__verbose(tselftverbose((s!/usr/lib64/python2.7/threading.pyt__init__:s cGsr|jrn||}t�}yt|j}Wntk
rJd|}nXd||f}tjj|�ndS(Ns<OS thread %d>s%s: %s
(Rt
_get_identt_activetnametKeyErrort_syststderrtwrite(RtformattargstidentR#((s!/usr/lib64/python2.7/threading.pyt_note?s
N(t__name__t
__module__RR R+(((s!/usr/lib64/python2.7/threading.pyR8scCs
|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!/usr/lib64/python2.7/threading.pyRYscCs
|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!/usr/lib64/python2.7/threading.pyRcscOs
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(R)tkwargs((s!/usr/lib64/python2.7/threading.pyRqs R1cBsbeZdZd
d�Zd�Zdd�ZeZd�Zd�Z d�Z
d�Zd �ZRS(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(RR
t_allocate_lockt
_RLock__blockRt
_RLock__ownert
_RLock__count(RR((s!/usr/lib64/python2.7/threading.pyR
�s cCsH|j}yt|j}Wntk
r-nXd|jj||jfS(Ns<%s owner=%r
count=%d>(R5R"R#R$t __class__R,R6(Rtowner((s!/usr/lib64/python2.7/threading.pyt__repr__�s
icCs�t�}|j|kr?|jd|_|jd||�dS|jj|�}|r||_d|_|jd||�n|jd||�|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.
is!%s.acquire(%s): recursive successs%s.acquire(%s): initial
successs%s.acquire(%s):
failure(R!R5R6R+R4tacquire(Rtblockingtmetrc((s!/usr/lib64/python2.7/threading.pyR:�s cCsx|jt�kr!td��n|jd|_}|sdd|_|jj�|jd|�n|jd|�dS(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 lockis%s.release(): final
releases%s.release(): non-final
releaseN(R5R!tRuntimeErrorR6RR4treleaseR+(Rtcount((s!/usr/lib64/python2.7/threading.pyR?�s
cCs|j�dS(N(R?(Rtttvttb((s!/usr/lib64/python2.7/threading.pyt__exit__�scCs?|\}}|jj�||_||_|jd|�dS(Ns%s._acquire_restore()(R4R:R6R5R+(Rtcount_ownerR@R8((s!/usr/lib64/python2.7/threading.pyt_acquire_restore�s
cCsK|jd|�|j}d|_|j}d|_|jj�||fS(Ns%s._release_save()i(R+R6R5RR4R?(RR@R8((s!/usr/lib64/python2.7/threading.pyt
_release_save�s
cCs|jt�kS(N(R5R!(R((s!/usr/lib64/python2.7/threading.pyt _is_owned�sN(
R,R-t__doc__RR
R9R:t __enter__R?RDRFRGRH(((s!/usr/lib64/python2.7/threading.pyR1|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(R)R2((s!/usr/lib64/python2.7/threading.pyR�sRKcBs}eZdZddd�Zd�Zd�Zd�Zd�Zd�Z d�Z
ded�Zd 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(RR
RRt_Condition__lockR:R?RGtAttributeErrorRFRHt_Condition__waiters(RtlockR((s!/usr/lib64/python2.7/threading.pyR
s&
cCs
|jj�S(N(RLRJ(R((s!/usr/lib64/python2.7/threading.pyRJscGs|jj|�S(N(RLRD(RR)((s!/usr/lib64/python2.7/threading.pyRDscCsd|jt|j�fS(Ns<Condition(%s,
%d)>(RLtlenRN(R((s!/usr/lib64/python2.7/threading.pyR9"scCs|jj�dS(N(RLR?(R((s!/usr/lib64/python2.7/threading.pyRG%scCs|jj�dS(N(RLR:(Rtx((s!/usr/lib64/python2.7/threading.pyRF(scCs+|jjd�r#|jj�tStSdS(Ni(RLR:R?tFalsetTrue(R((s!/usr/lib64/python2.7/threading.pyRH+s
c Cs~|j�std��nt�}|j�|jj|�|j�}z|d krv|j�|jd|�n�t �|}d}x�t
r|jd�}|r�Pnt|t �|�}|dkr�Pn|r�t|d|d�}n|}t �|}t|�q�W|sU|jd||�y|jj
|�Wqhtk
rQqhXn|jd||�Wd |j|�Xd S(
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 locks%s.wait(): got
itg����Mb@?iig�������?s%s.wait(%s): timed
outs%s.wait(%s): got
itN(RHR>R3R:RNtappendRGRR+t_timeRStmint_sleeptremovet
ValueErrorRF( Rttimeoutt balancingtwaitertsaved_statetendtimetdelaytgotitt remaining((s!/usr/lib64/python2.7/threading.pytwait4s@
icCs�|j�std��n|j}||
}|sH|jd|�dS|jd|||dkridpld�x=|D]5}|j�y|j|�Wqwtk
r�qwXqwWdS(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 locks%s.notify(): no
waitersNs"%s.notify(): notifying %d
waiter%sitst(RHR>RNR+R?RXRY(RtnRNtwaitersR\((s!/usr/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(RgRPRN(R((s!/usr/lib64/python2.7/threading.pyt notifyAll�sN(R,R-RIRR
RJRDR9RGRFRHRSRbRgRht
notify_all(((s!/usr/lib64/python2.7/threading.pyRK�s D 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(R)R2((s!/usr/lib64/python2.7/threading.pyR
�s RjcBsAeZdZddd�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(RYRR
RRt_Semaphore__condt_Semaphore__value(RtvalueR((s!/usr/lib64/python2.7/threading.pyR
�s
c Cs�t}|j�wxo|jdkrU|s,Pn|jd|||j�|jj�qW|jd|_|jd||j�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.
is)%s.acquire(%s): blocked waiting, value=%sis%s.acquire:
success,
value=%sN(RRRkRlR+RbRS(RR;R=((s!/usr/lib64/python2.7/threading.pyR:�s
cCsG|j�8|jd|_|jd||j�|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.
is%s.release: success,
value=%sN(RkRlR+Rg(R((s!/usr/lib64/python2.7/threading.pyR?�s
cCs|j�dS(N(R?(RRARBRC((s!/usr/lib64/python2.7/threading.pyRD�sN( R,R-RIRR
R:RJR?RD(((s!/usr/lib64/python2.7/threading.pyRj�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(R)R2((s!/usr/lib64/python2.7/threading.pyR�sRncBs&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(RjR
t_initial_value(RRmR((s!/usr/lib64/python2.7/threading.pyR
scCs.|j|jkr!td��ntj|�S(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
times(RlRoRYRjR?(R((s!/usr/lib64/python2.7/threading.pyR?s
N(R,R-RIRR
R?(((s!/usr/lib64/python2.7/threading.pyRnscOs
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(R)R2((s!/usr/lib64/python2.7/threading.pyR
sRpcBsSeZdZdd�Zd�Zd�ZeZd�Zd�Z de
d�ZRS(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(RR
RRt_Event__condRRt_Event__flag(RR((s!/usr/lib64/python2.7/threading.pyR
2scCs|jj�dS(N(RqR
(R((s!/usr/lib64/python2.7/threading.pyt_reset_internal_locks7scCs|jS(s5Return
true if and only if the internal flag is
true.(Rr(R((s!/usr/lib64/python2.7/threading.pytisSet;scCs<|jj�zt|_|jj�Wd|jj�XdS(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(RqR:RSRrRiR?(R((s!/usr/lib64/python2.7/threading.pytsetAs
cCs/|jj�z
t|_Wd|jj�XdS(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(RqR:RRRrR?(R((s!/usr/lib64/python2.7/threading.pytclearOs
cCsL|jj�z*|js/|jj||�n|jSWd|jj�XdS(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(RqR:RrRbR?(RRZR[((s!/usr/lib64/python2.7/threading.pyRb\s
N(R,R-RIRR
RsRttis_setRuRvRSRb(((s!/usr/lib64/python2.7/threading.pyRp)s
is Thread-%dcCstda|tS(Ni(t_counter(ttemplate((s!/usr/lib64/python2.7/threading.pyt_newnameus
cBs=eZdZeZejZejZ ddddddd�Zd�Ze
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�|dkstd��tj||�|dkr=i}n||_t|pUt��|_||_||_ |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.
s#group argument must be None for nowN(RtAssertionErrorRR
t_Thread__targettstrRzt
_Thread__namet
_Thread__argst_Thread__kwargst_set_daemont_Thread__daemonict_Thread__identR
t_Thread__startedRRt_Thread__stoppedRRt_Thread__blockRSt_Thread__initializedR%R&t_Thread__stderr(RtgroupttargetR#R)R2R((s!/usr/lib64/python2.7/threading.pyR
�s cCs0t|d�r|jj�n|jj�dS(NR�(thasattrR�R
R�Rs(R((s!/usr/lib64/python2.7/threading.pyRs�scCs|jS(N(R�(R((s!/usr/lib64/python2.7/threading.pyt_block�scCs
t�jS(N(Rtdaemon(R((s!/usr/lib64/python2.7/threading.pyR��scCs�|jstd��d}|jj�r3d}n|jrEd}n|jr[|d7}n|jdk r~|d|j7}nd|jj |j
|fS(Ns Thread.__init__() was not calledtinitialtstartedtstoppeds
daemons %ss<%s(%s,
%s)>(R�R{R�RwR�R�R�RR7R,R~(Rtstatus((s!/usr/lib64/python2.7/threading.pyR9�s
cCs�|jstd��n|jj�r6td��n|jd|�t�|t|<WdQXyt|jd�Wn(t k
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
onces%s.start(): starting
threadN((R�R>R�RwR+t_active_limbo_lockt_limbot_start_new_threadt_Thread__bootstrapt ExceptionRb(R((s!/usr/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(R|RR�(R((s!/usr/lib64/python2.7/threading.pytrun�s cCs8y|j�Wn#|jr-tdkr-dS�nXdS(N(t_Thread__bootstrap_innerR�R%R(R((s!/usr/lib64/python2.7/threading.pyt__bootstraps
cCst�|_dS(N(R!R�(R((s!/usr/lib64/python2.7/threading.pyt
_set_identsc
Cs z�|j�|jj�t�|t|j<t|=WdQX|jd|�trq|jd|�t j
t�ntr�|jd|�t jt�nz,y|j
�Wntk
r�|jd|�n�|jd|�t rt jjd|jt�f�q�|j�\}}}z�|jd|jdIJ|jd IJxB|r�|jd
|jjj|j|jjjfIJ|j}qGW|jd||fIJWd~~~XnX|jd|�Wd|j�XWdt�'|j�ytt�=WnnXWdQXXdS(
Ns
%s.__bootstrap(): thread starteds(%s.__bootstrap(): registering trace
hooks*%s.__bootstrap(): registering profile hooks#%s.__bootstrap(): raised
SystemExits%%s.__bootstrap(): unhandled exceptionsException in thread %s:
%s
sException 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(R�R�RuR�R"R�R�R+R0R%RR.RR�t
SystemExitR&R'R#t_format_exct_Thread__exc_infoR�ttb_frametf_codetco_filenamet tb_linenotco_namettb_nextt_Thread__exc_cleart
_Thread__stopR!(Rtexc_typet exc_valuetexc_tb((s!/usr/lib64/python2.7/threading.pyt__bootstrap_inners^
cCsGt|d�sdS|jj�t|_|jj�|jj�dS(NR�(R�R�R:RSR�RiR?(R((s!/usr/lib64/python2.7/threading.pyt__stopds
cCsHyt�tt�=WdQXWn&tk
rCdtjkrD�qDnXdS(sARemove current thread from the dict of
currently running
threads.Ntdummy_threading(R�R"R!R$R%tmodules(R((s!/usr/lib64/python2.7/threading.pyt__deletens
cCs?|jstd��n|jj�s6td��n|t�krTtd��n|jsp|jd|�n|jj�z�|dkr�x|js�|jj
�q�W|jd|�nmt�|}x]|js|t�}|dkr|jd|�Pn|jj
||�q�W|jd|�Wd|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 threads%%s.join(): waiting until thread
stopss%s.join(): thread stoppedis%s.join(): timed
outN(
R�R>R�RwRR�R+R�R:RRbRUR?(RRZR[tdeadlineR_((s!/usr/lib64/python2.7/threading.pytjoin�s.
cCs|jstd��|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.
sThread.__init__() not
called(R�R{R~(R((s!/usr/lib64/python2.7/threading.pyR#�scCs(|jstd��t|�|_dS(NsThread.__init__()
not
called(R�R{R}R~(RR#((s!/usr/lib64/python2.7/threading.pyR#�scCs|jstd��|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.
sThread.__init__() not
called(R�R{R�(R((s!/usr/lib64/python2.7/threading.pyR*�s cCs,|jstd��|jj�o+|jS(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.
sThread.__init__() not
called(R�R{R�RwR�(R((s!/usr/lib64/python2.7/threading.pytisAlive�scCs|jstd��|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 no alive non-daemon threads
are
left.
sThread.__init__() not
called(R�R{R�(R((s!/usr/lib64/python2.7/threading.pyR��s
cCsC|jstd��n|jj�r6td��n||_dS(NsThread.__init__()
not calleds)cannot set daemon status of active
thread(R�R>R�RwR�(Rtdaemonic((s!/usr/lib64/python2.7/threading.pyR�s
cCs|jS(N(R�(R((s!/usr/lib64/python2.7/threading.pytisDaemon
scCs
||_dS(N(R�(RR�((s!/usr/lib64/python2.7/threading.pyt setDaemon
scCs|jS(N(R#(R((s!/usr/lib64/python2.7/threading.pytgetNamescCs
||_dS(N(R#(RR#((s!/usr/lib64/python2.7/threading.pytsetNamesN(($R,R-RIRRR�R%texc_infoR�t exc_clearR�RR
RstpropertyR�R�R9R�R�R�R�R�R�t_Thread__deleteRSR�R#tsetterR*R�tis_aliveR�R�R�R�R�(((s!/usr/lib64/python2.7/threading.pyR�s: (
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(R)R2((s!/usr/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(RR
tintervaltfunctionR)R2R
tfinished(RR�R�R)R2((s!/usr/lib64/python2.7/threading.pyR
-s
cCs|jj�dS(s(Stop the timer if it hasn't
finished
yetN(R�Ru(R((s!/usr/lib64/python2.7/threading.pytcancel5scCsL|jj|j�|jj�s;|j|j|j�n|jj�dS(N(R�RbR�RwR�R)R2Ru(R((s!/usr/lib64/python2.7/threading.pyR�9s(R,R-RIR
R�R�(((s!/usr/lib64/python2.7/threading.pyR�$s t_MainThreadcBs#eZd�Zd�Zd�ZRS(cCsHtj|dd�|jj�|j�t�|tt�<WdQXdS(NR#t
MainThread(RR
R�RuR�R�R"R!(R((s!/usr/lib64/python2.7/threading.pyR Ds
cCstS(N(RR(R((s!/usr/lib64/python2.7/threading.pyR�KscCsj|j�t�}|r,|jd|�nx|rK|j�t�}q/W|jd|�|j�dS(Ns%s:
waiting for other threadss%s:
exiting(R�t_pickSomeNonDaemonThreadR+R�R�(RRA((s!/usr/lib64/python2.7/threading.pyt _exitfuncNs
(R,R-R
R�R�(((s!/usr/lib64/python2.7/threading.pyR�Bs cCs2x+t�D]
}|jr
|j�r
|Sq
WdS(N(R R�R�R(RA((s!/usr/lib64/python2.7/threading.pyR�[st_DummyThreadcBs)eZd�Zd�Zded�ZRS(cCsTtj|dtd��|`|jj�|j�t�|tt �<WdQXdS(NR#sDummy-%d(
RR RzR�R�RuR�R�R"R!(R((s!/usr/lib64/python2.7/threading.pyR
ls
cCstS(N(RS(R((s!/usr/lib64/python2.7/threading.pyR�yscCststd��dS(Nscannot
join a dummy
thread(RRR{(RRZR[((s!/usr/lib64/python2.7/threading.pyR�|sN(R,R-R
R�RRSR�(((s!/usr/lib64/python2.7/threading.pyR�js
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"R!R$R�(((s!/usr/lib64/python2.7/threading.pyR�s
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�RPR"R�(((s!/usr/lib64/python2.7/threading.pyR�scCstj�tj�S(N(R"tvaluesR�(((s!/usr/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!/usr/lib64/python2.7/threading.pyR �s(R(t_local(RcCs�t�ai}t�}t��xetj�D]W}t|d�rN|j�n||kryt�}||_|||<q,|j �q,Wt
j�tj�tj|�t
t�dks�t�WdQXdS(NRsi(R3R�RR"t
itervaluesR�RsR!R�R�R�RvtupdateRPR{(t
new_activetcurrenttthreadR*((s!/usr/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(
NtBoundedQueuecBs#eZd�Zd�Zd�ZRS(cSsVtj|�t�|_t|j�|_t|j�|_||_t�|_ dS(N(
RR
RtmonRR=twctlimitt_dequetqueue(RR�((s!/usr/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�R:RPR�R�R+R�RbRTR=RgR?(Rtitem((s!/usr/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�R:R�R+R=RbtpopleftRPR�RgR?(RR�((s!/usr/lib64/python2.7/threading.pytget�s
(R,R-R
R�R�(((s!/usr/lib64/python2.7/threading.pyR��s tProducerThreadcBseZd�Zd�ZRS(cSs)tj|dd�||_||_dS(NR#tProducer(RR
R�tquota(RR�R�((s!/usr/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#RW(RR�tcounter((s!/usr/lib64/python2.7/threading.pyR�s
(R,R-R
R�(((s!/usr/lib64/python2.7/threading.pyR�s tConsumerThreadcBseZd�Zd�ZRS(cSs)tj|dd�||_||_dS(NR#tConsumer(RR
R�R@(RR�R@((s!/usr/lib64/python2.7/threading.pyR
s cSs>x7|jdkr9|jj�}|GH|jd|_qWdS(Nii(R@R�R�(RR�((s!/usr/lib64/python2.7/threading.pyR�s(R,R-R
R�(((s!/usr/lib64/python2.7/threading.pyR�s iiisProducer-%dig���ư>(RRtrangeR#RTR�RWR�(R�R�R�tNPtQLtNItQtPtiRAtC((s!/usr/lib64/python2.7/threading.pyt_test�s(
t__main__(JRItsysR%R�tImportErrorR�R,twarningstcollectionsRR�RRURRWt tracebackRR�t__all__tstart_new_threadR�t
allocate_lockR3t get_identR!terrortThreadErrortfilterwarningstDeprecationWarningRRRtobjectRRR.R0RRRRR1RRKR
RjRRnR
RpRxRzR�R"R�RRR�R�R�R�RRRRR�R RR�t _shutdownR�Rt_threading_localR�R�(((s!/usr/lib64/python2.7/threading.pyt<module>s�
u
� J
K ��
% R