File "thread.cpython-37.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python37/lib64/python3.7/concurrent/futures/__pycache__/thread.cpython-37.pyc
File size: 5.3 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

B

 fA@sdZdZddlZddlmZddlZddlZddlZddlZddl	Z	e
ZdaddZ
ee
Gdd	d	eZd
dZGdd
d
ejZGdddejZdS)zImplements ThreadPoolExecutor.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_queueinitializerinitargsZexecutor	work_itemrrr_workerBs2

r$c@seZdZdZdS)BrokenThreadPoolzR
    Raised when a worker thread in a ThreadPoolExecutor failed initializing.
    N)rrr__doc__rrrr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)	aInitializes 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.
        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)rZmax_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)rrEZnum_threadsZthread_namer	rrrr@s



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__r8rrCrExecutorr&r@rrMrrrrr'ls


r')r&
__author__atexitZconcurrent.futuresrrNr1r6rHr+WeakKeyDictionaryrrr
registerobjectrr$ZBrokenExecutorr%rQr'rrrr<module>s 	
$