+
     Bii&                        R t Rt^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	]P                  ! 4       tRs]P                  ! 4       tR t]P                   ! ]4       ]! ]	R4      '       dQ   ]	P$                  ! ]P&                  ]P(                  ]P*                  R7       ]	P$                  ! ]P,                  R7        ! R	 R
4      t ! R R4      tR t ! R R]P4                  4      t ! R R]P8                  4      tR# )zImplements ThreadPoolExecutor.z"Brian Quinlan (brian@sweetapp.com))_baseNFc                     \         ;_uu_ 4        R sRRR4       \        \        P	                  4       4      p V  F  w  rVP                  R4       K  	  V  F  w  rVP                  4        K  	  R#   + '       g   i     Lf; iTN)_global_shutdown_lock	_shutdownlist_threads_queuesitemsputjoin)r	   tqs      0/usr/lib/python3.14/concurrent/futures/thread.py_python_exitr      sZ    			 
&&()E	d 	  
	s   A00B 	register_at_fork)beforeafter_in_childafter_in_parent)r   c                   H   a  ] tR t^/t o ]R 4       tR tR tR tR t	Rt
V tR# )WorkerContextc                d   a aa Se   \        S4      '       g   \        R4      hV VV3R lpR pW43# )Nzinitializer must be a callablec                     < S ! SS4      # N )clsinitargsinitializers   r   create_context-WorkerContext.prepare.<locals>.create_context6   s    {H--    c                 
    WV3# r   r   )fnargskwargss   &&&r   resolve_task+WorkerContext.prepare.<locals>.resolve_task8   s    f%%r   )callable	TypeError)r   r   r   r   r$   s   fff  r   prepareWorkerContext.prepare1   s3    "K(( @AA	.	&++r   c                    Wn         W n        R # r   r   r   )selfr   r   s   &&&r   __init__WorkerContext.__init__<   s    & r   c                Z    V P                   e   V P                   ! V P                  !   R # R # r   r+   r,   s   &r   
initializeWorkerContext.initialize@   s%    'dmm, (r   c                    R # r   r   r0   s   &r   finalizeWorkerContext.finalizeD   s    r   c                    Vw  r#pV! V/ VB # r   r   )r,   taskr!   r"   r#   s   &&   r   runWorkerContext.runG   s    &4"6""r   )r   r   N)__name__
__module____qualname____firstlineno__classmethodr(   r-   r1   r4   r8   __static_attributes____classdictcell____classdict__s   @r   r   r   /   s0     , ,!-# #r   r   c                   P   a  ] tR t^Lt o R tR t]! ]P                  4      t	Rt
V tR# )	_WorkItemc                    Wn         W n        R # r   futurer7   )r,   rG   r7   s   &&&r   r-   _WorkItem.__init__M   s    	r   c                $   V P                   P                  4       '       g   R #  VP                  V P                  4      pV P                   P	                  V4       R #   \
         d)   pT P                   P                  T4       R p  R p?R # R p?ii ; ir   )rG   set_running_or_notify_cancelr8   r7   
set_resultBaseExceptionset_exception)r,   ctxresultexcs   &&  r   r8   _WorkItem.runQ   sl    {{7799	+WWTYY'F KK""6*  	KK%%c*D	s   A B'B

BrF   N)r:   r;   r<   r=   r-   r8   r>   typesGenericAlias__class_getitem__r?   r@   rA   s   @r   rD   rD   L   s"     + $E$6$67r   rD   c                 &    VP                  4           TP                  4       pTe   TP                  T4       ?K*  T ! 4       p\        '       g   Te   TP                  '       d0   Te   RTn        TP                  R4        TP                  4        R# ?K    \         dA    \        P                  P	                  R RR7       T ! 4       pTe   TP                  4         R# i ; i  \        P                   d=    T ! 4       pTe   TP                  P                  4        ?TP                  RR7      p ELi ; i  \         d%    \        P                  P	                  RRR7        Mi ; iTP                  4        R#   TP                  4        i ; i)zException in initializer:T)exc_infoN)blockzException in worker)r1   rL   r   LOGGERcritical_initializer_failed
get_nowaitqueueEmpty_idle_semaphorereleasegetr8   r   r
   r4   )executor_referencerN   
work_queueexecutor	work_items   &&&  r   _workerre   a   sa   #7&113	 $c")+H
 yH,0B0B0B ')-H&t$
 		 K  9DI%'((* ;; 7-/',,446&NNN6	78  D3dCD 	sj   B D: C& *D: D: &D: D: AC#"C#&AD73D: 6D77D: :,E)&E> (E))E> >Fc                       ] tR t^tRtRtR# )BrokenThreadPoolzJ
Raised when a worker thread in a ThreadPoolExecutor failed initializing.
r   N)r:   r;   r<   r=   __doc__r?   r   r   r   rg   rg      s    r   rg   c                   ,  a  ] tR t^t o ]t]P                  ! 4       P                  t	]
R 4       tRR ltR t]P                  P                  P                   ]n        R tR tRRR/R	 llt]P                  P&                  P                   ]n        R
tV tR# )ThreadPoolExecutorc                ,    \         P                  W4      # r   )r   r(   )r   r   r   s   &&&r   prepare_context"ThreadPoolExecutor.prepare_context   s    $$[;;r   Nc                   Vf1   \        ^ \        P                  ! 4       ;'       g    ^^,           4      pV^ 8:  d   \        R4      h\	        V 4      P
                  ! W43/ VB w  V n        V n        Wn        \        P                  ! 4       V n        \        P                  ! ^ 4      V n        \        4       V n        RV n        RV n        \        P&                  ! 4       V n        T;'       g    RV P+                  4       ,          V n        R# )a  Initializes a new ThreadPoolExecutor instance.

Args:
    max_workers: The maximum number of threads that can be used to
        execute the given calls.
    thread_name_prefix: An optional name prefix to give our threads.
    initializer: A callable used to initialize worker threads.
    initargs: A tuple of arguments to pass to the initializer.
    ctxkwargs: Additional arguments to cls.prepare_context().
Nz"max_workers must be greater than 0FzThreadPoolExecutor-%d)minosprocess_cpu_count
ValueErrortyperl   _create_worker_context_resolve_work_item_task_max_workersr\   SimpleQueue_work_queue	threading	Semaphorer^   set_threads_brokenr   Lock_shutdown_lock_counter_thread_name_prefix)r,   max_workersthread_name_prefixr   r   	ctxkwargss   &&&&&,r   r-   ThreadPoolExecutor.__init__   s      b2#7#7#9#>#>Q!"CDK!ABB $Z''KK		$		% ( ,,.(2215'nn.$6 %P %P%<t}}%N 	 r   c          	     T   V P                   ;_uu_ 4        \        ;_uu_ 4        V P                  '       d   V P                  V P                  4      hV P                  '       d   \        R 4      h\        '       d   \        R4      h\        P                  ! 4       pV P                  WV4      p\        WE4      pV P                  P                  V4       V P                  4        VuuRRR4       uuRRR4       #   + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdownN)r   r   r}   BROKENr   RuntimeErrorr   Futureru   rD   rx   r
   _adjust_thread_count)r,   r!   r"   r#   fr7   ws   ""*,   r   submitThreadPoolExecutor.submit   s       "7"7|||kk$,,//~~~"#OPPy" $: ; ; A//&AD!"A  #%%'! #8"7  "7"7    s/   D?C9	$C9	;A)C9	$
D9D	DD'	c                   V P                   P                  ^ R7      '       d   R# V P                  3R lp\        V P                  4      pW P
                  8  d   RV P                  ;'       g    T V3,          p\        P                  ! V\        \        P                  ! W4      V P                  4       V P                  3R7      pVP                  4        V P                  P                  V4       V P                  \        V&   R# R# )    )timeoutNc                 (    VP                  R 4       R # r   )r
   )_r   s   &&r   
weakref_cb;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cb   s    EE$Kr   z%s_%d)nametargetr"   )r^   acquirerx   lenr|   rv   r   ry   Threadre   weakrefrefrt   startaddr   )r,   r   num_threadsthread_namer   s   &    r   r   'ThreadPoolExecutor._adjust_thread_count   s    '''22 !,, 	 $--(***!T%=%=%E%E%0%2 2K  k''.{{4'D'+'B'B'D'+'7'7'9:A GGIMMa !%!1!1OA +r   c                \   V P                   ;_uu_ 4        R V n          V P                  P                  4       pTf   K"  TP                  P                  T P                  T P                  4      4       KX    \        P
                   d     Mi ; iRRR4       R#   + '       g   i     R# ; i)zBA thread initializer failed, the thread pool is not usable anymoreN)	r   r}   rx   r[   r\   r]   rG   rM   r   )r,   rd   s   & r   rZ   &ThreadPoolExecutor._initializer_failed   s       4DL  $ 0 0 ; ; =I ($$224;;t||3LM {{  !   s2   	BA5B6B5B
BBBB+	cancel_futuresFc                  V P                   ;_uu_ 4        R V n        V'       d?     V P                  P                  4       pTf   K"  TP                  P                  4        K>  V P                  P                  R4       RRR4       V'       d&   V P                   F  pVP                  4        K  	  R# R#   \        P
                   d     Kj  i ; i  + '       g   i     L[; ir   )r   r   rx   r[   r\   r]   rG   cancelr
   r|   r   )r,   waitr   rd   r   s   &&$  r   shutdownThreadPoolExecutor.shutdown   s       !DN $($4$4$?$?$A	 !,!((//1   & !  ]] #  !;;  ! s4   CB5C7C5C
CCCC!	)
r}   rt   r^   rv   ru   r   r   r   r|   rx   )N Nr   )T)r:   r;   r<   r=   rg   r   	itertoolscount__next__r   r>   rl   r-   r   r   Executorrh   r   rZ   r   r?   r@   rA   s   @r   rj   rj      s     F  ))H< <$QL$ ^^**22FN2,NE ( ~~..66Hr   rj   )rh   
__author__concurrent.futuresr   r   r\   ry   rR   r   rp   WeakKeyDictionaryr   r   r~   r   r   _register_atexithasattrr   r   _at_fork_reinitr_   clearr   rD   re   BrokenExecutorrg   r   rj   r   r   r   <module>r      s    %1
 $      	 ++-	 "(  
  < ( 2!""4<<'<'L'L(=(E(EG '<'<=# #:8 8*,^u++ |7 |7r   