Your IP : 18.117.10.207


Current Path : /opt/alt/python33/lib64/python3.3/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/multiprocessing/__pycache__/queues.cpython-33.pyc

�
��f-c@s8dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlm
Z
ddlmZmZmZmZddlmZmZmZmZdd	lmZGd
d�de�Ze�ZGdd�de�ZGdd�de�ZdS(
uQueueuSimpleQueueu
JoinableQueueiN(uEmptyuFull(uPipe(uLockuBoundedSemaphoreu	Semaphoreu	Condition(udebuguinfouFinalizeuregister_after_fork(uassert_spawningcBs
|EeZdZddd�Zdd�Zdd�Zdd	�Zd'd&d
d�Z	d'd&dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zed"d#��Zed$d%��Zd&S((uQueueicCs�|dkrtjj}n||_tdd�\|_|_t�|_	t
j�|_t
jdkrud|_nt�|_t|�|_d|_|j�t
jdkr�t|tj�ndS(Niuduplexuwin32F(u_multiprocessinguSemLocku
SEM_VALUE_MAXu_maxsizeuPipeuFalseu_readeru_writeruLocku_rlockuosugetpidu_opidusysuplatformuNoneu_wlockuBoundedSemaphoreu_semu
_ignore_epipeu_after_forkuregister_after_forkuQueue(uselfumaxsize((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__init__!s		
uQueue.__init__cCs>t|�|j|j|j|j|j|j|j|jfS(N(	uassert_spawningu
_ignore_epipeu_maxsizeu_readeru_writeru_rlocku_wlocku_semu_opid(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__getstate__5s
uQueue.__getstate__c	CsD|\|_|_|_|_|_|_|_|_|j�dS(N(	u
_ignore_epipeu_maxsizeu_readeru_writeru_rlocku_wlocku_semu_opidu_after_fork(uselfustate((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__setstate__:s6uQueue.__setstate__cCs�td�tjtj��|_tj�|_d|_	d|_
d|_d|_
d|_|jj|_|jj|_|jj|_dS(NuQueue._after_fork()F(udebugu	threadingu	ConditionuLocku	_notemptyucollectionsudequeu_bufferuNoneu_threadu_jointhreaduFalseu_joincancelledu_closedu_closeu_writerusendu_sendu_readerurecvu_recvupollu_poll(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu_after_fork?s
					uQueue._after_forkc
Cs�|jst�|jj||�s.t�n|jj�z=|jdkrZ|j�n|j	j
|�|jj�Wd|jj�XdS(N(
u_closeduAssertionErroru_semuacquireuFullu	_notemptyu_threaduNoneu
_start_threadu_bufferuappendunotifyurelease(uselfuobjublockutimeout((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuputLs	

u	Queue.putcCs|rT|dkrT|jj�z!|j�}|jj�|SWd|jj�Xn�|rmtj�|}n|jj||�s�t�nzt|r�|tj�}|dks�|j|�r�t�q�n|j�s�t�n|j�}|jj�|SWd|jj�XdS(Ni(	uNoneu_rlockuacquireu_recvu_semureleaseutimeuEmptyu_poll(uselfublockutimeouturesudeadline((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyugetZs,

		
u	Queue.getcCs|j|jjj�S(N(u_maxsizeu_semu_semlocku
_get_value(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuqsizevsuQueue.qsizecCs|j�S(N(u_poll(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuemptyzsuQueue.emptycCs|jjj�S(N(u_semu_semlocku_is_zero(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyufull}su
Queue.fullcCs
|jd�S(NF(ugetuFalse(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu
get_nowait�suQueue.get_nowaitcCs|j|d�S(NF(uputuFalse(uselfuobj((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu
put_nowait�suQueue.put_nowaitcCs0d|_|jj�|jr,|j�ndS(NT(uTrueu_closedu_readerucloseu_close(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuclose�s	
	uQueue.closecCs3td�|jst�|jr/|j�ndS(NuQueue.join_thread()(udebugu_closeduAssertionErroru_jointhread(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyujoin_thread�s
	uQueue.join_threadcCs=td�d|_y|jj�Wntk
r8YnXdS(NuQueue.cancel_join_thread()T(udebuguTrueu_joincancelledu_jointhreaducanceluAttributeError(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyucancel_join_thread�s
	
uQueue.cancel_join_threadc
Cstd�|jj�tjdtjd|j|j|j|j	|j
j|jfdd�|_
d|j
_td�|j
j�td�|jtj�k}|jr�|r�t|j
tjtj|j
�gdd�|_nt|tj|j|jgdd
�|_dS(
NuQueue._start_thread()utargetuargsunameuQueueFeederThreadudoing self._thread.start()u... done self._thread.start()uexitpriorityii
Ti����(udebugu_bufferuclearu	threadinguThreaduQueueu_feedu	_notemptyu_sendu_wlocku_writerucloseu
_ignore_epipeu_threaduTrueudaemonustartu_opiduosugetpidu_joincancelleduFinalizeu_finalize_joinuweakrefurefu_jointhreadu_finalize_closeu_close(uselfucreated_by_this_process((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu
_start_thread�s*

		


	uQueue._start_threadcCsDtd�|�}|dk	r6|j�td�n
td�dS(Nujoining queue threadu... queue thread joinedu... queue thread already dead(udebuguNoneujoin(utwruthread((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu_finalize_join�s
	

uQueue._finalize_joinc
CsAtd�|j�z|jt�|j�Wd|j�XdS(Nutelling queue thread to quit(udebuguacquireuappendu	_sentinelunotifyurelease(ubufferunotempty((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu_finalize_close�s


uQueue._finalize_closecCs�td�ddlm}|j}|j}|j}	|j}
t}tj	dkrh|j}|j}
nd}y�x�|�z|s�|	�nWd|�Xymxf|
�}||kr�td�|�dS|dkr�||�q�|�z||�Wd|
�Xq�Wqttk
rYqtXqtWn�tk
r�}zr|rZt
|dd�tjkrZdSy3|�rvtd|�nddl}|j�Wntk
r�YnXWYdd}~XnXdS(	Nu$starting thread to feed data to pipei(u
is_exitinguwin32u%feeder thread got sentinel -- exitinguerrnoiuerror in queue thread: %s(udebuguutilu
is_exitinguacquireureleaseuwaitupopleftu	_sentinelusysuplatformuNoneu
IndexErroru	ExceptionugetattruerrnouEPIPEuinfou	tracebacku	print_exc(ubufferunotemptyusendu	writelockucloseuignore_epipeu
is_exitingunacquireunreleaseunwaitubpopleftusentineluwacquireuwreleaseuobjueu	traceback((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu_feed�sV
						


!	
uQueue._feedNT(u__name__u
__module__u__qualname__u__init__u__getstate__u__setstate__u_after_forkuTrueuNoneuputugetuqsizeuemptyufullu
get_nowaitu
put_nowaitucloseujoin_threaducancel_join_threadu
_start_threadustaticmethodu_finalize_joinu_finalize_closeu_feed(u
__locals__((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuQueues$
&

cBse|EeZdZddd�Zdd�Zdd�Zdddd	�Zd
d�Z	dd
�Z
dS(u
JoinableQueueicCs/tj||�td�|_t�|_dS(Ni(uQueueu__init__u	Semaphoreu_unfinished_tasksu	Conditionu_cond(uselfumaxsize((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__init__suJoinableQueue.__init__cCstj|�|j|jfS(N(uQueueu__getstate__u_condu_unfinished_tasks(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__getstate__suJoinableQueue.__getstate__cCs:tj||dd��|dd�\|_|_dS(Nii����i����(uQueueu__setstate__u_condu_unfinished_tasks(uselfustate((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__setstate__"suJoinableQueue.__setstate__c
Cs�|jst�|jj||�s.t�n|jj�|jj�zJ|jdkrg|j	�n|j
j|�|jj
�|jj�Wd|jj
�|jj
�XdS(N(u_closeduAssertionErroru_semuacquireuFullu	_notemptyu_condu_threaduNoneu
_start_threadu_bufferuappendu_unfinished_tasksureleaseunotify(uselfuobjublockutimeout((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuput&s	




uJoinableQueue.putc
Csi|jj�zG|jjd�s1td��n|jjj�rS|jj�nWd|jj�XdS(Nu!task_done() called too many timesF(	u_conduacquireu_unfinished_tasksuFalseu
ValueErroru_semlocku_is_zerou
notify_allurelease(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu	task_done7s
uJoinableQueue.task_donec
CsH|jj�z&|jjj�s2|jj�nWd|jj�XdS(N(u_conduacquireu_unfinished_tasksu_semlocku_is_zerouwaiturelease(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyujoinAs

uJoinableQueue.joinNT(u__name__u
__module__u__qualname__u__init__u__getstate__u__setstate__uTrueuNoneuputu	task_doneujoin(u
__locals__((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu
JoinableQueues
cBsP|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS(uSimpleQueuecCsktdd�\|_|_t�|_|jj|_tj	dkrQd|_nt�|_|j�dS(Nuduplexuwin32F(
uPipeuFalseu_readeru_writeruLocku_rlockupollu_pollusysuplatformuNoneu_wlocku
_make_methods(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__init__OsuSimpleQueue.__init__cCs|j�S(N(u_poll(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuemptyYsuSimpleQueue.emptycCs&t|�|j|j|j|jfS(N(uassert_spawningu_readeru_writeru_rlocku_wlock(uself((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__getstate__\s
uSimpleQueue.__getstate__cCs,|\|_|_|_|_|j�dS(N(u_readeru_writeru_rlocku_wlocku
_make_methods(uselfustate((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu__setstate__`suSimpleQueue.__setstate__cs�|jj�|jj|jj�����fdd�}||_|jdkrg|jj	|_
nF|jj	�|jj|jj�����fdd�}||_
dS(Nc
s!��z��SWd��XdS(N(((uracquireurecvurrelease(u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyugetgsu&SimpleQueue._make_methods.<locals>.getc
s$��z�|�SWd��XdS(N((uobj(usenduwacquireuwrelease(u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuputusu&SimpleQueue._make_methods.<locals>.put(u_readerurecvu_rlockuacquireureleaseugetu_wlockuNoneu_writerusenduput(uselfugetuput((uracquireurecvurreleaseusenduwacquireuwreleaseu;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu
_make_methodsds	uSimpleQueue._make_methodsN(u__name__u
__module__u__qualname__u__init__uemptyu__getstate__u__setstate__u
_make_methods(u
__locals__((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyuSimpleQueueMs

(u__all__usysuosu	threadingucollectionsutimeuweakrefuerrnouqueueuEmptyuFullu_multiprocessingumultiprocessing.connectionuPipeumultiprocessing.synchronizeuLockuBoundedSemaphoreu	Semaphoreu	Conditionumultiprocessing.utiludebuguinfouFinalizeuregister_after_forkumultiprocessing.forkinguassert_spawninguobjectuQueueu	_sentinelu
JoinableQueueuSimpleQueue(((u;/opt/alt/python33/lib64/python3.3/multiprocessing/queues.pyu<module>
s"""�	
5

?>