• File: thread.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/concurrent/futures/__pycache__/thread.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 4.77 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~dA@sdZddlZddlmZddlZddlZddlZddlZddlZe	Z
daddZe
eGdddeZd	d
ZGdddejZGd
ddejZdS)z"Brian Quinlan (brian@sweetapp.com)N)_baseFcCsJdatt}x|D]\}}|dqWx|D]\}}|q2WdS)NT)	_shutdownlist_threads_queuesitemsputjoin)rtqr>/opt/alt/python37/lib64/python3.7/concurrent/futures/thread.py_python_exit!sr
c@seZdZddZddZdS)	_WorkItemcCs||_||_||_||_dS)N)futurefnargskwargs)selfrrrrrrr__init__.sz_WorkItem.__init__c
Csf|jsdSy|j|j|j}Wn2tk
rT}z|j|d}Wdd}~XYnX|j|dS)N)rZset_running_or_notify_cancelrrr
BaseException
set_exceptionZ
set_result)rresultexcrrrrun4s
z
_WorkItem.runN)__name__
__module____qualname__rrrrrrr-srcCs|dk	rPy||Wn:tk
rNtjjddd|}|dk	rJ|dSXy`xZ|jdd}|dk	rt|~qT|}ts|dks|jr|dk	rd|_|ddS~qTWWn$tk
rtjjdddYnXdS)NzException in initializer:T)exc_info)blockzException in worker)	rrZLOGGERZcritical_initializer_failedgetrrr)Zexecutor_referenceZ
work_queueinitializerinitargsexecutor	work_itemrrr_workerBs2

r%c@seZdZdS)BrokenThreadPoolN)rrrrrrrr&fsr&c@sZeZdZejZdddZddZe	j
jje_dd	Zd
dZ
dd
dZe	j
jje_dS)ThreadPoolExecutorNrcCs|dkrtpdd}|dkr(td|dk	r@t|s@td||_t|_t	|_
d|_d|_t
|_|p|d||_||_||_dS)Nrz"max_workers must be greater than 0zinitializer must be a callableFzThreadPoolExecutor-%d)os	cpu_count
ValueErrorcallable	TypeError_max_workersqueueZSimpleQueue_work_queueset_threads_brokenr	threadingZLock_shutdown_lock_counter_thread_name_prefix_initializer	_initargs)rmax_workersZthread_name_prefixr!r"rrrrqs 

zThreadPoolExecutor.__init__c	Ost|dkr|^}}}n>|s&tdn0d|krB|d}|^}}ntdt|d|jZ|jrnt|j|jr|tdtrtdt	}t
||||}|j||
|SQRXdS)NzDdescriptor 'submit' of 'ThreadPoolExecutor' object needs an argumentrz6submit expected at least 1 positional argument, got %dr)z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)lenr/popr7r5r&rRuntimeErrorrZFuturerr2r_adjust_thread_count)rrrrfwrrrsubmits*



zThreadPoolExecutor.submitcCs|jfdd}t|j}||jkr~d|jp,||f}tj|tt	|||j|j
|jfd}d|_|
|j||jt|<dS)NcSs|ddS)N)r)_r
rrr
weakref_cbsz;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cbz%s_%d)nametargetrT)r2r>r4r0r9r6ZThreadr%weakrefrefr:r;Zdaemonstartaddr)rrFZnum_threadsZthread_namer	rrrrAs



z'ThreadPoolExecutor._adjust_thread_countc	Csd|jTd|_xFy|j}Wntjk
r6PYnX|dk	r|jt|jqWWdQRXdS)NzBA thread initializer failed, the thread pool is not usable anymore)	r7r5r2Z
get_nowaitr1ZEmptyrrr&)rr$rrrrsz&ThreadPoolExecutor._initializer_failedTc	CsD|jd|_|jdWdQRX|r@x|jD]}|q0WdS)NT)r7rr2rr4r)rwaitr	rrrshutdownszThreadPoolExecutor.shutdown)Nr(Nr)T)rrr	itertoolscount__next__r8rrDrExecutor__doc__rArrNrrrrr'ls


r')
__author__atexitconcurrent.futuresrrOr1r6rIr+WeakKeyDictionaryrrr
registerobjectrr%ZBrokenExecutorr&rRr'rrrr<module>s	
$