python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
threading.cpython-312.opt-1.pyc

ˑe dZddlZddlZddlZddlZddlmZ	ddl
mZddlm
Z	ddlmZgdZej*Zej.Zej2Zej6Zej8Z	ej:ZdZej?d	ejBZ"	ejFZ$ejJZ%[da&da'dZ(dZ)d
Z*dZ+dZ,dZ-eZ.dZ#GddZ/e/Z0GddZ1GddZ2Gdde2Z3GddZ4GddZ5Gdde6Z7ed jpZ9d!Z:e#a;iZ<iZ=eZ>ea?e@aAd"ZBGd#d$ZC	dd%lmDaEmFZGtZLd,ZMGd-d.eCZNGd/d0eCZOGd1d2eCZPd3ZQd4ZRd5ZSd6ZTd7ZUd8ZVgZWd
aXd9ZYdd:lmZZZeOa[d;Z\d<Z]	dd=lm^Z_d?Zaebed@rejeaAyy#e$r
ddlmZYwxYw#e $rd
ZYpwxYw#e $rdZ$YewxYw#e$rdd&lHmIZJdd'lmKZKeKd(d)ZFd*ZGd+aEYwxYw#e$r	dd>l`m_Z_YwxYw)Bz;Thread module emulating a subset of Java's threading model.N)	monotonic)WeakSet)count)deque)	get_identactive_count	Conditioncurrent_thread	enumeratemain_threadTIMEOUT_MAXEventLockRLock	SemaphoreBoundedSemaphoreThreadBarrierBrokenBarrierErrorTimerThreadError
setprofilesettracelocal
stack_size
excepthookExceptHookArgsgettrace
getprofilesetprofile_all_threadssettrace_all_threadsT
get_native_idFc|ay)zSet 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
_profile_hookfuncs =/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/threading.pyrr<s	McDt|tj|y)zSet a profile function for all threads started from the threading module
    and all Python threads that are currently executing.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.
    N)r_sys_setprofileallthreadsr&s r(r r Estt$r)ctS)z;Get the profiler function as set by threading.setprofile().r$r)r(rrOsr)c|ay)zSet 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_trace_hookr&s r(rrSs	Kr)cDt|tj|y)zSet a trace function for all threads started from the threading module
    and all Python threads that are currently executing.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.
    N)rr+_settraceallthreadsr&s r(r!r!\s
TNT"r)ctS)z6Get the trace function as set by threading.settrace().r0r.r)r(rrfsr)c:tt|i|St|i|S)a2Factory 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.

    )_CRLock_PyRLock)argskwargss  r(rrns)(((D#F##r)cLeZdZdZdZdZdZddZeZdZ	dZ
dZd	Zd
Z
y)
_RLocka,This class implements reentrant lock objects.

    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.

    c>t|_d|_d|_yNr)_allocate_lock_block_owner_countselfs r(__init__z_RLock.__init__s$&r)c6|j}	t|j}d|jjrdnd|jj|jj||jtt|fzS#t$rYvwxYw)Nz)<%s %s.%s object owner=%r count=%d at %s>lockedunlocked)r@_activenameKeyErrorr?rF	__class__
__module____qualname__rAhexid)rCowners  r(__repr__z_RLock.__repr__s	EN''E;**,H*NN%%NN''KK4M
>

	
		sB	BBcT|jjd|_d|_yr=)r?_at_fork_reinitr@rArBs r(rSz_RLock._at_fork_reinits ##%r)ct}|j|k(r|xjdz
c_y|jj	||}|r||_d|_|S)aAcquire 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.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        )rr@rAr?acquire)rCblockingtimeoutmercs     r(rVz_RLock.acquiresT4[;;"KK1K
[[
 
 7
3
DKDK	r)c|jtk7rtd|jdz
x|_}|s"d|_|jjyy)amRelease 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.

        cannot release un-acquired lockrUN)r@rRuntimeErrorrAr?release)rCrs  r(r^z_RLock.releasesQ ;;)+%@AA"kkAo-eDKKK!r)c$|jyNr^rCtvtbs    r(__exit__z_RLock.__exit__r)cV|jj|\|_|_yr`)r?rVrAr@)rCstates  r(_acquire_restorez_RLock._acquire_restores #( T[r)c|jdk(rtd|j}d|_|j}d|_|jj	||fS)Nrr\)rAr]r@r?r^)rCrrPs   r(
_release_savez_RLock._release_savesT;;!@AAu~r)c0|jtk(Sr`)r@rrBs r(	_is_ownedz_RLock._is_owneds{{ik))r)NT)__name__rLrM__doc__rDrQrSrV	__enter__r^rfrjrlrnr.r)r(r;r;{s<



"HI".
)*r)r;cfeZdZdZddZdZdZdZdZdZ	d	Z
d
ZddZddZ
dd
ZdZdZy)r	ajClass that implements a condition variable.

    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.

    Nc:|
t}||_|j|_|j|_t	|dr|j
|_t	|dr|j|_t	|dr|j|_t|_	y)Nrlrjrn)
r_lockrVr^hasattrrlrjrn_deque_waitersrClocks  r(rDzCondition.__init__s|<7D
||||4)!%!3!3D4+,$($9$9D!4%!^^DN
r)cl|jj|jjyr`)rvrSryclearrBs r(rSzCondition._at_fork_reinits"

""$

r)c6|jjSr`)rvrsrBs r(rszCondition.__enter__szz##%%r)c4|jj|Sr`)rvrf)rCr8s  r(rfzCondition.__exit__s"tzz""D))r)cJd|jt|jfzS)Nz<Condition(%s, %d)>)rvlenryrBs r(rQzCondition.__repr__s$

C

4F'GGGr)c8|jjyr`)rvr^rBs r(rlzCondition._release_save

r)c8|jjyr`)rvrV)rCxs  r(rjzCondition._acquire_restore"rr)cp|jjdr|jjyy)NFT)rvrVr^rBs r(rnzCondition._is_owned%s,::e$JJ r)cN|jstdt}|j|jj||j
}d}	||jd}n)|dkDr|jd|}n|jd}||j||s	|jj|SS#t$rYSwxYw#|j||s,	|jj|w#t$rYwwxYwwxYw)akWait 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 notify_all() 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.

        zcannot wait on un-acquired lockFTr)
rnr]r>rVryappendrlrjremove
ValueError)rCrXwaitersaved_stategotits     r(waitzCondition.wait.s.~~@AA!

V$((*	 Q;"NN49E"NN51E!!+.MM((0"	
!!+.MM((0!sB$?C#7C	C C #D$8DD$	D D$D  D$cd}|}|}|sB|%|t|z}n|tz
}|dkr	|S|j||}|sB|S)zWait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        Nr)_timer)rC	predicaterXendtimewaittimeresults      r(wait_forzCondition.wait_for^sm#?#g0G&0H1}

IIh[F
r)c|jstd|j}|r=|dkDr7|d}	|j|dz}	|j	||r|dkDr5yyyy#t$rY)wxYw#t
$rY&wxYw)aKWake 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.

        z!cannot notify on un-acquired lockrrUN)rnr]ryr^rr)rCnwaitersrs    r(notifyzCondition.notifyus~~BCC--!a%QZF	
 Q
v&!a%g%g 




s#A(A7(	A43A47	BBcL|jt|jy)zWake 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)rrryrBs r(
notify_allzCondition.notify_alls	
C

&'r)c\ddl}|jdtd|jy)zvWake up all threads waiting on this condition.

        This method is deprecated, use notify_all() instead.

        rNz3notifyAll() is deprecated, use notify_all() instead
stacklevel)warningswarnDeprecationWarningrrCrs  r(	notifyAllzCondition.notifyAlls*	

K(Q		8r)r`rU)rqrLrMrrrDrSrsrfrQrlrjrnrrrrrr.r)r(r	r	sJ	!$&*H.`.<(	r)r	c8eZdZdZddZdZd	dZeZddZdZ	y)
raGThis class implements semaphore objects.

    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.

    cb|dkrtdtt|_||_y)Nrz$semaphore initial value must be >= 0)rr	r_cond_value)rCvalues  r(rDzSemaphore.__init__s*19CDDtv&
r)c	|j}d|jd|jdt|dd|jd	S)N<. at #x: value=>)rKrLrMrOrrCclss  r(rQzSemaphore.__repr__sKnnCNN#1S%5%5$6d2d8B-H++a)	*r)Ncb|s
|tdd}d}|j5|jdk(rS|sng|#|t|z}n|tz
}|dkrnB|jj	||jdk(rS|xjdzc_d}ddd|S#1swY|SxYw)aAcquire 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.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        Nz.can't specify timeout for non-blocking acquireFrrUT)rrrrr)rCrWrXrZrs     r(rVzSemaphore.acquires0G/MNN

ZZ	++"&"''G"3")EG"3"a<!

(++"q 				sA"B$B$$B.c|dkrtd|j5|xj|z
c_|jj|dddy#1swYyxYw)zRelease a semaphore, incrementing the internal counter by one or more.

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

        rUn must be one or moreN)rrrrrCrs  r(r^zSemaphore.releasesS
q5455
ZZ	!KK1KJJa 	!	!	!s1AA c$|jyr`rarbs    r(rfzSemaphore.__exit__rgr)r)TN)
rqrLrMrrrDrQrVrsr^rfr.r)r(rrs(*
+ZI!r)rc2eZdZdZdfd	ZdZddZxZS)raImplements a 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.

    c2t||||_yr`)superrD_initial_value)rCrrKs  r(rDzBoundedSemaphore.__init__s
#r)c|j}d|jd|jdt|dd|jd|j
dS)Nrrrrr/r)rKrLrMrOrrrs  r(rQzBoundedSemaphore.__repr__sYnnCNN#1S%5%5$6d2d8B-H++a(;(;'<A?	@r)c|dkrtd|j5|j|z|jkDrtd|xj|z
c_|jj	|dddy#1swYyxYw)a>Release a semaphore, incrementing the internal counter by one or more.

        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.

        rUrz!Semaphore released too many timesN)rrrrrrs  r(r^zBoundedSemaphore.releasesu
q5455
ZZ	!{{Q!4!44 !DEEKK1KJJa 		!	!	!sAA>>Br)rqrLrMrrrDrQr^
__classcell__)rKs@r(rrs $@
!r)rcBeZdZdZdZdZdZdZdZdZ	dZ
dd
Zy	)rzClass implementing event objects.

    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.  The flag is initially false.

    cBtt|_d|_y)NF)r	rr_flagrBs r(rDzEvent.__init__7stv&

r)c	|j}|jrdnd}d|jd|jdt	|dd|d	S)	Nsetunsetrrrrz: r)rKrrLrMrO)rCrstatuss   r(rQzEvent.__repr__;sLnn**'3>>"!C$4$4#5T"T(2bPQRRr)c8|jjyr`)rrSrBs r(rSzEvent._at_fork_reinit@s

""$r)c|jS)z5Return true if and only if the internal flag is true.)rrBs r(is_setzEvent.is_setDszzr)cZddl}|jdtd|jS)zyReturn true if and only if the internal flag is true.

        This method is deprecated, use is_set() instead.

        rNz+isSet() is deprecated, use is_set() insteadrr)rrrrrs  r(isSetzEvent.isSetHs,	

C(Q		8{{}r)c|j5d|_|jjdddy#1swYyxYw)zSet the internal flag to true.

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

        TN)rrrrBs r(rz	Event.setSs7ZZ	$DJJJ!!#	$	$	$s	"8AcT|j5d|_dddy#1swYyxYw)zReset the internal flag to false.

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

        FN)rrrBs r(r}zEvent.clear^s'ZZ	DJ			s'Nc|j5|j}|s|jj|}|cdddS#1swYyxYw)aHBlock 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)rrr)rCrXsignaleds   r(rz
Event.waithsAZZ	zzH::??73				s+AAr`)rqrLrMrrrDrQrSrrrr}rr.r)r(rr,s0S
%		$r)rceZdZdZddZdZddZdZdZdZ	d	Z
d
ZdZdZ
ed
ZedZedZy)rzImplements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    Ncztt|_||_||_||_d|_d|_y)aWCreate a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        rN)r	rr_action_timeout_parties_staterA)rCpartiesactionrXs    r(rDzBarrier.__init__s5tv&


r)c|j}|jr*d|jd|jdt	|ddSd|jd|jdt	|dd|j
d|jdS)	Nrrrrz	: broken>z
: waiters=rr)rKbrokenrLrMrO	n_waitingrrs  r(rQzBarrier.__repr__snn;;s~~&a(8(8'9bhr])TTCNN#1S%5%5$6d2d8B-H NN+1T\\N!=	>r)c||j}|j5|j|j}|xjdz
c_	|dz|jk(r|jn|j
|||xjdzc_|jcdddS#|xjdzc_|jwxYw#1swYyxYw)aNWait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        NrU)rr_enterrAr_release_wait_exit)rCrXindexs   r(rzBarrier.waits?mmG
ZZ	KKMKKEKK1K
19

-MMOJJw'q 

		q 

		s#2C5B2%C2'CCC%c|jdvr)|jj|jdvr)|jdkrty)NrprUr)rrrrrBs r(rzBarrier._entersBkkW$JJOOkkW$;;?$$r)c	|jr|jd|_|jjy#|j	xYw)NrU)rrrr_breakrBs r(rzBarrier._releasesA		||DKJJ!!#	KKMs=AAcjjfd|sjtjdkrty)Nc"jdk7Sr=rrBsr(<lambda>zBarrier._wait.<locals>.<lambda>sDKK1,<r)r)rrrrrrCrXs` r(rz
Barrier._waits=zz""#<gFKKM$$;;?$$r)c|jdk(r1|jdvr"d|_|jjyyy)Nrr)rArrrrBs r(rz
Barrier._exits;;;!{{g%

%%'&r)c|j5|jdkDr.|jdk(rd|_n|jdk(rd|_nd|_|jjdddy#1swYyxYw)zReset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        rrpN)rrArrrBs r(resetz
Barrier.resetsjZZ	${{Q;;!#"$DK[[B&#%DKJJ!!#	$	$	$sAA55A>cf|j5|jdddy#1swYyxYw)zPlace the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        N)rrrBs r(abortz
Barrier.aborts)ZZ	KKM			s'0cFd|_|jjy)Nr)rrrrBs r(rzBarrier._breaks

r)c|jS)z:Return the number of threads required to trip the barrier.)rrBs r(rzBarrier.partiess}}r)c:|jdk(r|jSy)z>Return the number of threads currently waiting at the barrier.r)rrArBs r(rzBarrier.n_waitings
;;!;;r)c |jdk(S)z0Return True if the barrier is in a broken state.rrrBs r(rzBarrier.broken$s{{b  r)NNr`)rqrLrMrrrDrQrrrrrrrrpropertyrrrr.r)r(rrsu >< 
 ($( !!r)rceZdZy)rN)rqrLrMr.r)r(rr*sr)rrUc|tzSr`)_counter)
name_templates r(_newnamer0s8:%%r)ctDcgc]}|jr|}}tj|ycc}w)a!
    Drop any shutdown locks that don't correspond to running threads anymore.

    Calling this from time to time avoids an ever-growing _shutdown_locks
    set when Thread objects are not joined explicitly. See bpo-37788.

    This must be called with _shutdown_locks_lock acquired.
    N)_shutdown_locksrFdifference_update)r{	to_removes  r(_maintain_shutdown_locksrBs3#2G$GIG%%i0Hs;;c&eZdZdZdZ		ddddZdZdZdZd	Z	d
Z
dZerdZ
d
ZdZdZdZddZd dZedZej,dZedZeredZdZedZej,dZdZdZdZdZy)!raA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    FN)daemonc|i}|rt|}n#td}|	|j}|d|dz
}||_||_||_||_||rtstd||_
ntj|_
d|_
trd|_d|_t#|_d|_d|_t*j,|_t1|_t4j7|y#t$rYwxYw)aUThis 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 a list or tuple of arguments 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.

        Nz	Thread-%dz ()z4daemon threads are disabled in this (sub)interpreterFT)strrrqAttributeError_target_name_args_kwargs_daemon_threads_allowedr]	_daemonicr
r_ident_HAVE_THREAD_NATIVE_ID
_native_id_tstate_lockr_started_is_stopped_initializedr+stderr_stderr_make_invoke_excepthook_invoke_excepthook	_danglingadd)rCgrouptargetrIr8r9rtarget_names        r(rDzThread.__init__]s0>Ft9DK(D!"(//Kb
Q//D

57"#YZZ#DN+-44DN!"DO 
  {{"9";

d1&sC>>	D
	D
c|jj|rB|j5|jj|jjyyd|_d|_yNT)rrSrrVr)rCis_alives  r(_reset_internal_lockszThread._reset_internal_lockss`	


%%'  ,!!113!!))+- $D $Dr)c,d}|jjrd}|j|jrd}|jr|dz
}|j
|d|j
zz
}d|jjd|jd|d	S)
Ninitialstartedstoppedz daemonz %sr(z, z)>)	rrrrrr
rKrqr)rCrs  r(rQzThread.__repr__s}==!F

F>>iF;;"edkk))F!%!8!8$**fMMr)c|jstd|jjrtdt5|t
|<ddd	t
|jd|jjy#1swY;xYw#t$r$t5t
|=ddd#1swYxYwwxYw)a-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.

        zthread.__init__() not calledz threads can only be started onceNr.)
rr]rr_active_limbo_lock_limbo_start_new_thread
_bootstrap	ExceptionrrBs r(startzThread.starts  =>>==!ABB
	 F4L	 	door2
	


	 	 	#
!4L
!
!	s0
BBBC"B3*	C3B<	8Cc	|j&|j|ji|j|`|`|`y#|`|`|`wxYw)aXMethod 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)rr	r
rBs r(runz
Thread.runsI	7||'djj9DLL9dj$,dj$,s	2;AcZ	|jy#|jrtYyxYwr`)_bootstrap_innerrr+rBs r(r*zThread._bootstraps+	!!#	~~$,s**c"t|_yr`)rr
rBs r(
_set_identzThread._set_identskr)c"t|_yr`)r"rrBs r(_set_native_idzThread._set_native_ids+oDOr)ct|_|jj|js9t5ttj|jdddyy#1swYyxYw)z
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        N)
_set_sentinelrrVr_shutdown_locks_lockrrrrBs r(_set_tstate_lockzThread._set_tstate_locksc
*O!!#{{%
7(*##D$5$56
7
7
7
7s*A00A9c(	|j|jtr|j|jjt5|t|j<t|=dddtrtjttrtjt	|j|j#y#1swYixYw#|j!|Y2xYw#|j#wxYwr`)r2r8rr4rrr'rHr
r(r1r+rr%rr.r_deleterBs r(r0zThread._bootstrap_inners	OO!!#%##%MM#
!'+$4L
!

k*
.
.

LLN
!
!
.''-LLNs7AC?C3AC?:C'C$ C?'C<:C??Dc|j}|d|_d|_|jst5t	dddyyy#1swYyxYwr)rrrr7rrzs  r(_stopzThread._stop"sU"   {{%
+(*
+
+
+
+sAAcXt5tt=dddy#1swYyxYw)zARemove current thread from the dict of currently running threads.N)r'rHrrBs r(r:zThread._delete=s$
	%	$	%	%	%s )c|jstd|jjstd|t	urtd||jy|jt
|dy)aWait 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
        is_alive() 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.

        Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadNr)rX)rr]rrr
_wait_for_tstate_lockmaxrs  r(joinzThread.joinFsv0  =>>}}##%HII>##;<<?&&(
&&s7A&?r)c|j}|y	|j||r!|j|jyy#|j	r |j|jxYwr`)rrVr^r<rF)rCblockrXr{s    r(r@zThread._wait_for_tstate_locklsj  <
	||E7+

,	{{}


s2A3A8c|jS)zA 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.

        )rrBs r(rIzThread.nameszzr)c$t||_yr`)rr)rCrIs  r(rIzThread.namesY
r)c|jS)a4Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the 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
rBs r(identzThread.idents{{r)c|jS)zNative integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            )rrBs r(	native_idzThread.native_ids??"r)c|js|jjsy|jd|jS)zReturn whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. See also the module function
        enumerate().

        F)rrrr@rBs r(rzThread.is_alives<4==#7#7#9""5)####r)c|jS)aA boolean value indicating whether this thread is a daemon thread.

        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.

        )rrBs r(rz
Thread.daemons~~r)c|jstd|rtstd|jj	rtd||_y)Nr?z/daemon threads are disabled in this interpreterz)cannot set daemon status of active thread)rr]rrrr)rCdaemonics  r(rz
Thread.daemonsO  =>>35PQQ==!JKK!r)cRddl}|jdtd|jS)zwReturn whether this thread is a daemon.

        This method is deprecated, use the daemon attribute instead.

        rNz:isDaemon() is deprecated, get the daemon attribute insteadrrrrrrrs  r(isDaemonzThread.isDaemons*	

R(Q		8{{r)cJddl}|jdtd||_y)ztSet whether this thread is a daemon.

        This method is deprecated, use the .daemon property instead.

        rNz;setDaemon() is deprecated, set the daemon attribute insteadrrrP)rCrNrs   r(	setDaemonzThread.setDaemons'	

S(Q		8r)cRddl}|jdtd|jS)zReturn a string used for identification purposes only.

        This method is deprecated, use the name attribute instead.

        rNz7getName() is deprecated, get the name attribute insteadrrrrrrIrs  r(getNamezThread.getNames*	

O(Q		8yyr)cJddl}|jdtd||_y)zrSet the name string for this thread.

        This method is deprecated, use the name attribute instead.

        rNz7setName() is deprecated, set the name attribute insteadrrrU)rCrIrs   r(setNamezThread.setNames'	

O(Q		8	r))NNNr.Nr`ro)rqrLrMrrrrDr rQr,r.r*r2rr4r8r0r<r:rBr@rrIsetterrHrJrrrQrSrVrXr.r)r(rrRsL59!%:15:x%"N47"("	.7.+6%$@L6
[[				#
	#$]]""				r)r)_excepthook_ExceptHookArgs)print_exception)
namedtuplerz'exc_type exc_value exc_traceback threadct|Sr`)r[)r8s r(rrs
%%r)c|jtk(ryt!tjtj}n&|j|jj
}|yy|j|jj}n
t}td|d|dt|j|j|j||jy)z9
        Handle uncaught Thread.run() exception.
        NzException in thread :Tfileflush)rb)
exc_type
SystemExitr+rthreadrrIrprint_print_exception	exc_value
exc_tracebackrc)r8rrIs   r(rrs==J& 7[[F
[[
$[[((F~
;;";;##D;D
$TF!,	'8J8J$	&r)cttjtdtdtjttfd}|S)Nzthreading.excepthook is Nonezsys.excepthook is NonecX	t}|}tg
|}||d}y#t$rm}d|_~j
j}n|j
}d|dj
j}n	}|
Yd}~d}yd}~wwxYw#d}wxYw)NTz"Exception in threading.excepthook:ra)rrr+__suppress_context__rr)rfhookr8excrsys_excepthooklocal_print	local_sysold_excepthookold_sys_excepthooksys_exc_infos      r(invoke_excepthookz2_make_invoke_excepthook.<locals>.invoke_excepthookEs	D|%!";LN";F";<DJ*D)	,'+C$$)9)9)E"))<#4
1$)=)=)I!*!5!5!3LN+D)	,(Ds'&,	B"A!BB%B""B%%B))rr+r]exc_inforg)rvrqrrrsrtrus @@@@@r(rr5s^
 N9::!344==LKI@r)c$eZdZdZddZdZdZy)rzCall a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    Nctj|||_||_||ng|_||ni|_t
|_yr`)rrDintervalfunctionr8r9rfinished)rCrzr{r8r9s     r(rDzTimer.__init__ssA 
 
 ,D"	 & 2f
r)c8|jjy)z)Stop the timer if it hasn't finished yet.N)r|rrBs r(cancelzTimer.cancel{s

r)c|jj|j|jjs&|j|j
i|j|jjyr`)r|rrzrr{r8r9rrBs r(r.z	Timer.runsS

4==)}}##%DMM49944

r)r)rqrLrMrrrDr~r.r.r)r(rrjs r)rceZdZdZy)_MainThreadc0tj|dd|j|jj	|jtr|jt5|t|j<dddy#1swYyxYw)N
MainThreadFrIr)rrDr8rrr2rr4r'rHr
rBs r(rDz_MainThread.__init__so<>

!!
	(#'GDKK 	(	(	(s/BBN)rqrLrMrDr.r)r(rrs(r)rc&eZdZdZdZdZddZy)_DummyThreadc2tj|tdt|jj|j
tr|jt5|t|j<dddy#1swYyxYw)NzDummy-%dr)rrDrrrrr2rr4r'rHr
rBs r(rDz_DummyThread.__init__ss8J#768		:	


!!
	(#'GDKK 	(	(	(s0B

Bcyr`r.rBs r(r<z_DummyThread._stopsr)cyrr.rBs r(rz_DummyThread.is_alivesr)Ncyr`r.rs  r(rBz_DummyThread.joinsr)r`)rqrLrMrDr<rrBr.r)r(rrs	(
3r)rcX	ttS#t$r
tcYSwxYw)zReturn 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.

    )rHrrJrr.r)r(r
r
s+y{##~s))cNddl}|jdtdtS)zReturn the current Thread object, corresponding to the caller's thread of control.

    This function is deprecated, use current_thread() instead.

    rNz;currentThread() is deprecated, use current_thread() insteadrr)rrrr
rs r(
currentThreadrs)MMO$4r)cxt5ttttzcdddS#1swYyxYw)zReturn the number of Thread objects currently alive.

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

    N)r'rrHr(r.r)r(rrs,
*7|c&k)***s09cNddl}|jdtdtS)zxReturn the number of Thread objects currently alive.

    This function is deprecated, use active_count() instead.

    rNz7activeCount() is deprecated, use active_count() insteadrr)rrrrrs r(activeCountrs(MMK$4>r)cxttjttjzSr`)listrHvaluesr(r.r)r(
_enumeraters$ !D$999r)ct5ttjttjzcdddS#1swYyxYw)zReturn 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'rrHrr(r.r)r(rrs;
>GNN$%V]]_(==>>>s;AActrtdtj|g|i|}tj|y)aCPython internal: register *func* to be called before joining threads.

    The registered *func* is called with its arguments just before all
    non-daemon threads are joined in `_shutdown()`. It provides a similar
    purpose to `atexit.register()`, but its functions are called prior to
    threading shutdown instead of interpreter shutdown.

    For similarity to atexit, the registered functions are called in reverse.
    z$can't register atexit after shutdownN)_SHUTTING_DOWNr]	functoolspartial_threading_atexitsr)r'argr9calls    r(_register_atexitrs;ABBT2C262Dd#r))rctjrydattD]	}|tj
t
k(r5tj}|jtjn		t5tt}tjdddsy|D]"}|j|j$]#1swY4xYw)zS
    Wait until the Python thread state of all non-daemon threads get deleted.
    NT)_main_threadrrreversedrrHrrr^r<r7rrr}rV)atexit_calltlocklocksr{s    r(	_shutdownrsN  23
Y[())
	

	

!	$)E!!#	$	DLLNLLN		$	$s$CC'ctS)zReturn the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    )rr.r)r(rrIs
r))_local)rcFtai}	tt}|atata
t5tt}|jt|D]O}||ur(|jdt}||_|||</|jd|j!Qt"j%tj%tj|dddy#t$r
t}YwxYw#1swYyxYw)zL
    Cleanup threading module state that should not exist after a fork.
    TFN)rr'rHrrJrrr>r7rrrupdaterr r
r<r(r})
new_activecurrentthreadsrfrHs     r(_after_forkrZsJ )+&L*+eO	!jl#y!
	F ,,T2! %
$*
5!,,U3
		

z"-!! -	 !!sC>B:D>DDD register_at_fork)after_in_child)drros_ossysr+_threadrtimerr_weakrefsetr	itertoolsrrA_collectionsrrxImportErrorcollections__all__start_new_threadr)daemon_threads_allowedr
allocate_lockr>r6rr"rrrerrorrrr6r
r%r1rr rrr!rrr;r7r	rrrrr]r__next__rrr'rHr(rr7rrrrrZrr[r	tracebackr\rhr]__excepthook__rrrrr
rrrrrrrrrrrrrr_threading_localrrwrr.r)r(<module>rsA#%,,<,,!88&&%%
	#))M!NN?#mmmmG!!

%#$t*t*lqqhTTn*!y*!ZOOz^!^!B		
!9&W
	I	
&'%1 nnb
+<\0jF<
(&
(*3634
	
*	:	>$"}2p''
2!j3"#C4$E4,++,>#"#
Gj&(=& 13O&(`
'&'sYG -G2HH9H4 G/.G/2G=<G=H
H H10H14II