File "thread.cpython-35.pyc"

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



Yf@sdZdZddlZddlmZddlZddlZddlZddlZej	Z
daddZej
eGdd	d	eZd
dZGdd
d
ejZdS)zImplements ThreadPoolExecutor.z"Brian Quinlan (brian@sweetapp.com)N)_baseFcCsadattj}x!|D]\}}|jdqWx|D]\}}|jqCWdS)NT)	_shutdownlist_threads_queuesitemsputjoin)rtqr>/opt/alt/python35/lib64/python3.5/concurrent/futures/thread.py_python_exit sr
c@s(eZdZddZddZdS)	_WorkItemcCs(||_||_||_||_dS)N)futurefnargskwargs)selfrrrrrrr__init__,s			z_WorkItem.__init__cCs{|jjsdSy|j|j|j}Wn5tk
rf}z|jj|WYdd}~XnX|jj|dS)N)rZset_running_or_notify_cancelrrr
BaseExceptionZ
set_exceptionZ
set_result)rresulterrrrun2s#z
_WorkItem.runN)__name__
__module____qualname__rrrrrrr+srcCsyqxj|jdd}|dk	r4|j~q|}tsX|dksX|jri|jddS~qWWn(tk
rtjjdddYnXdS)NblockTzException in workerexc_info)getrrrrrZLOGGERZcritical)Zexecutor_referenceZ
work_queueZ	work_itemZexecutorrrr_worker=s
	

rc@sjeZdZdddZddZejjje_ddZdd	d
Z	ejj	je	_dS)ThreadPoolExecutorNcCsz|dkr"tjpdd}|dkr:td||_tj|_t|_d|_	t
j|_dS)zInitializes a new ThreadPoolExecutor instance.

        Args:
            max_workers: The maximum number of threads that can be used to
                execute the given calls.
        Nrz"max_workers must be greater than 0F)
os	cpu_count
ValueError_max_workersqueueZQueue_work_queueset_threadsr	threadingZLock_shutdown_lock)rZmax_workersrrrrTs		zThreadPoolExecutor.__init__cOsi|jY|jrtdtj}t||||}|jj||j|SWdQRXdS)Nz*cannot schedule new futures after shutdown)	r,rRuntimeErrorrZFuturerr(r_adjust_thread_count)rrrrfwrrrsubmiths
	
zThreadPoolExecutor.submitcCs|jdd}t|j|jkrtjdtdtj|||jf}d|_	|j
|jj||jt|<dS)NcSs|jddS)N)r)_r
rrr
weakref_cbxsz;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cbtargetrT)
r(lenr*r&r+ZThreadrweakrefrefZdaemonstartaddr)rr3r	rrrr.us	
z'ThreadPoolExecutor._adjust_thread_countTc	CsR|jd|_|jjdWdQRX|rNx|jD]}|jq:WdS)NT)r,rr(rr*r)rwaitr	rrrshutdowns
	zThreadPoolExecutor.shutdown)
rrrrr1rExecutor__doc__r.r;rrrrr Ssr )r=
__author__atexitZconcurrent.futuresrr'r+r6r#WeakKeyDictionaryrrr
registerobjectrrr<r rrrr<module>s