AlkantarClanX12

Your IP : 18.221.102.0


Current Path : /opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/queues.cpython-37.opt-2.pyc

B

YI~dC-�@s�dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlm
Z
ddlmZejjZdd	lmZmZmZmZmZGd
d�de�Ze�ZGdd�de�ZGdd�de�ZdS)
�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd+dd
�Zd,dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zed(d)��ZdS)-rrcCs�|dkrddlm}||_tjdd�\|_|_|��|_t	�
�|_tj
dkrTd|_n
|��|_|�|�|_d|_|��tj
dkr�t|tj�dS)Nrr)�
SEM_VALUE_MAXF)�duplex�win32)Zsynchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlockZBoundedSemaphore�_sem�
_ignore_epipe�_after_forkr
r)�self�maxsize�ctx�r$�;/opt/alt/python37/lib64/python3.7/multiprocessing/queues.py�__init__$s




zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS)N)
r	�assert_spawningrrrrrrrr)r!r$r$r%�__getstate__9s
zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dS)N)	rrrrrrrrr )r!�stater$r$r%�__setstate__>s$zQueue.__setstate__cCsbtd�t�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|jj|_dS)NzQueue._after_fork()F)r
�	threading�	Conditionr�	_notempty�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�
send_bytes�_send_bytesr�
recv_bytes�_recv_bytes�poll�_poll)r!r$r$r%r Cs


zQueue._after_forkTNc	CsP|j�||�st�|j�.|jdkr,|��|j�|�|j��WdQRXdS)N)	r�acquirerr-r1�
_start_threadr0�append�notify)r!�obj�block�timeoutr$r$r%�putPs
z	Queue.putc	Cs�|r2|dkr2|j�|��}WdQRX|j��nr|rBt��|}|j�||�sTt�zB|rv|t��}|�|�s�t�n|��s�t�|��}|j��Wd|j��Xt	�
|�S)N)rr9r�release�timeZ	monotonicr<rr;�_ForkingPickler�loads)r!rArB�resZdeadliner$r$r%�get[s&
z	Queue.getcCs|j|jj��S)N)rr�_semlock�
_get_value)r!r$r$r%�qsizesszQueue.qsizecCs
|��S)N)r;)r!r$r$r%�emptywszQueue.emptycCs|jj��S)N)rrJ�_is_zero)r!r$r$r%�fullzsz
Queue.fullcCs
|�d�S)NF)rI)r!r$r$r%�
get_nowait}szQueue.get_nowaitcCs|�|d�S)NF)rC)r!r@r$r$r%�
put_nowait�szQueue.put_nowaitcCs2d|_z|j��Wd|j}|r,d|_|�XdS)NT)r4r�closer5)r!rRr$r$r%rR�szQueue.closecCstd�|jr|��dS)NzQueue.join_thread())r
r2)r!r$r$r%�join_thread�szQueue.join_threadcCs6td�d|_y|j��Wntk
r0YnXdS)NzQueue.cancel_join_thread()T)r
r3r2Zcancel�AttributeError)r!r$r$r%�cancel_join_thread�szQueue.cancel_join_threadc
Cs�td�|j��tjtj|j|j|j|j	|j
j|j|j
|jfdd�|_d|j_td�|j��td�|js�t|jtjt�|j�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()ZQueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)Zexitpriority�
)r
r0�clearr+ZThreadr�_feedr-r7rrrRr�_on_queue_feeder_errorrr1Zdaemon�startr3r�_finalize_join�weakref�refr2�_finalize_closer5)r!r$r$r%r=�s*





zQueue._start_threadcCs4td�|�}|dk	r(|��td�ntd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r
�join)ZtwrZthreadr$r$r%r_�s
zQueue._finalize_joinc	Cs.td�|�|�t�|��WdQRXdS)Nztelling queue thread to quit)r
r>�	_sentinelr?)�buffer�notemptyr$r$r%rb�s
zQueue._finalize_closec
CsRtd�|j}|j}	|j}
|j}t}tjdkr<|j}
|j}nd}
�x
y�|�z|sX|
�Wd|	�Xybx\|�}||kr�td�|�dSt�	|�}|
dkr�||�qh|
�z||�Wd|�XqhWWnt
k
r�YnXWqDtk
�rH}zJ|�rt|dd�t
jk�rdSt��r&td|�dS|��|||�Wdd}~XYqDXqDWdS)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)r
r<rD�wait�popleftrdrrrF�dumps�
IndexError�	Exception�getattrrgZEPIPErr)rerfr6Z	writelockrRZignore_epipe�onerrorZ	queue_semZnacquireZnreleaseZnwaitZbpopleft�sentinelZwacquireZwreleaser@�er$r$r%r\�sR





zQueue._feedcCsddl}|��dS)Nr)�	traceback�	print_exc)rpr@rqr$r$r%r]
szQueue._on_queue_feeder_error)r)TN)TN)�__name__�
__module__�__qualname__r&r(r*r rCrIrLrMrOrPrQrRrSrUr=�staticmethodr_rbr\r]r$r$r$r%r"s&



 
>c@s@eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Zd	S)rrcCs*tj|||d�|�d�|_|��|_dS)N)r#r)rr&Z	Semaphore�_unfinished_tasksr,�_cond)r!r"r#r$r$r%r& szJoinableQueue.__init__cCst�|�|j|jfS)N)rr(rxrw)r!r$r$r%r(%szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr*rxrw)r!r)r$r$r%r*(szJoinableQueue.__setstate__TNc
Csl|j�||�st�|j�J|j�8|jdkr4|��|j�|�|j	�
�|j��WdQRXWdQRXdS)N)rr<rr-rxr1r=r0r>rwrDr?)r!r@rArBr$r$r%rC,s

zJoinableQueue.putc	Cs@|j�0|j�d�std��|jj��r2|j��WdQRXdS)NFz!task_done() called too many times)rxrwr<�
ValueErrorrJrNZ
notify_all)r!r$r$r%�	task_done8s
zJoinableQueue.task_donec	Cs,|j�|jj��s|j��WdQRXdS)N)rxrwrJrNrh)r!r$r$r%rc?szJoinableQueue.join)r)TN)	rsrtrur&r(r*rCr{rcr$r$r$r%rs

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCsHtjdd�\|_|_|��|_|jj|_tj	dkr:d|_
n
|��|_
dS)NF)rr)rrrrrrr:r;rrr)r!r#r$r$r%r&Js


zSimpleQueue.__init__cCs
|��S)N)r;)r!r$r$r%rMSszSimpleQueue.emptycCst�|�|j|j|j|jfS)N)r	r'rrrr)r!r$r$r%r(Vs
zSimpleQueue.__getstate__cCs"|\|_|_|_|_|jj|_dS)N)rrrrr:r;)r!r)r$r$r%r*ZszSimpleQueue.__setstate__c	Cs&|j�|j��}WdQRXt�|�S)N)rrr8rFrG)r!rHr$r$r%rI^szSimpleQueue.getc	CsDt�|�}|jdkr"|j�|�n|j�|j�|�WdQRXdS)N)rFrjrrr6)r!r@r$r$r%rCds


zSimpleQueue.putN)	rsrtrur&rMr(r*rIrCr$r$r$r%rHs	)�__all__rrr+r.rEr`rgZqueuerrZ_multiprocessing�rr	Z	reductionZForkingPicklerrF�utilr
rrr
r�objectrrdrrr$r$r$r%�<module>
s$
s
*