????

Your IP : 18.117.135.125


Current Path : /lib/python3.10/multiprocessing/__pycache__/
Upload File :
Current File : //lib/python3.10/multiprocessing/__pycache__/queues.cpython-310.pyc

o

�*�g�.�@s�gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlZddl
mZddl
mZejjZddlmZmZmZmZmZGdd	�d	e�Ze�ZGd
d�de�ZGdd
�d
e�ZdS))�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc@s�eZdZd-dd�Zdd�Zdd�Zdd	�Zd.dd�Zd/dd�Zd/dd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zed%d&��Zed'd(��Zed)d*��Zed+d,��ZdS)0rrcCs�|dkr
ddlm}||_tjdd�\|_|_|��|_t	�
�|_tj
dkr*d|_n|��|_|�|�|_d|_|��tj
dkrIt|tj�dSdS)Nrr)�
SEM_VALUE_MAXF��duplex�win32)�synchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlock�BoundedSemaphore�_sem�
_ignore_epipe�_resetr
r�_after_fork��self�maxsize�ctx�r)�-/usr/lib/python3.10/multiprocessing/queues.py�__init__%s




�zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS�N)
r	�assert_spawningr"rrrrrr!r�r&r)r)r*�__getstate__9s
�zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dSr,)	r"rrrrrr!rr#�r&�stater)r)r*�__setstate__>s�zQueue.__setstate__cCstd�|jdd�dS)NzQueue._after_fork()T)�
after_fork)r
r#r.r)r)r*r$CszQueue._after_forkFcCsj|r|j��nt�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|jj|_dS�NF)�	_notempty�_at_fork_reinit�	threading�	Conditionr�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�
send_bytes�_send_bytesr�
recv_bytes�_recv_bytes�poll�_poll)r&r3r)r)r*r#Gs


zQueue._resetTNcCs||jrtd|�d���|j�||�st�|j�|jdur!|��|j�	|�|j�
�Wd�dS1s7wYdS�NzQueue z
 is closed)r?�
ValueErrorr!�acquirerr5r<�
_start_threadr;�append�notify�r&�obj�block�timeoutr)r)r*�putVs
"�z	Queue.putcCs�|jrtd|�d���|r.|dur.|j�|��}Wd�n1s#wY|j��n>|r6t��|}|j�||�s?t	�z&|rP|t��}|�
|�sOt	�n|�
�sVt	�|��}|j��W|j��n|j��wt�|�SrG)
r?rHrrDr!�release�time�	monotonicrIrrF�_ForkingPickler�loads)r&rOrP�res�deadliner)r)r*�getbs.
�
�
z	Queue.getcCs|j|jj��Sr,)rr!�_semlock�
_get_valuer.r)r)r*�qsize|szQueue.qsizecC�
|��Sr,�rFr.r)r)r*�empty��
zQueue.emptycCs|jj��Sr,)r!rZ�_is_zeror.r)r)r*�full��z
Queue.fullcCs
|�d�Sr4)rYr.r)r)r*�
get_nowait�r`zQueue.get_nowaitcCs|�|d�Sr4)rQ�r&rNr)r)r*�
put_nowait�rczQueue.put_nowaitcCs$d|_|j}|rd|_|�dSdS)NT)r?r@)r&�closer)r)r*rg�s
�zQueue.closecCs2td�|jsJd�|���|jr|��dSdS)NzQueue.join_thread()zQueue {0!r} not closed)r
r?�formatr=r.r)r)r*�join_thread�s
�zQueue.join_threadcCs4td�d|_z|j��WdStyYdSw)NzQueue.cancel_join_thread()T)r
r>r=�cancel�AttributeErrorr.r)r)r*�cancel_join_thread�s�zQueue.cancel_join_threadcCs�td�|j��tjtj|j|j|j|j	|j
j|jj|j
|j|jf	dd�|_d|j_td�|j��td�|jsKt|jtjt�|j�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()�QueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)�exitpriority�
)r
r;�clearr7�Threadr�_feedr5rBrrrgrr"�_on_queue_feeder_errorr!r<�daemon�startr>r�_finalize_join�weakref�refr=�_finalize_closer@r.r)r)r*rJ�s4
��
�
�zQueue._start_threadcCs6td�|�}|dur|��td�dStd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r
�join)�twr�threadr)r)r*rz�szQueue._finalize_joincCsDtd�|�|�t�|��Wd�dS1swYdS)Nztelling queue thread to quit)r
rK�	_sentinelrL)�buffer�notemptyr)r)r*r}�s


"�zQueue._finalize_closec	
Csftd�|j}	|j}
|j}|j}t}
tjdkr|j}|j}nd}	zT|	�z
|s+|�W|
�n|
�wz6	|�}||
urKtd�|�|�WWdSt�	|�}|durY||�n|�z	||�W|�n|�wq6t
ysYnwWn<ty�}z0|r�t|dd�t
jkr�WYd}~dSt�r�td|�WYd}~dS|��|||�WYd}~nd}~wwq!)Nz$starting thread to feed data to piperrz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)r
rIrR�wait�popleftr�rrrU�dumps�
IndexError�	Exception�getattrr��EPIPErr)r�r�rA�	writelock�reader_close�writer_close�ignore_epipe�onerror�	queue_sem�nacquire�nrelease�nwait�bpopleft�sentinel�wacquire�wreleaserN�er)r)r*rv�sb
�


��
���zQueue._feedcCsddl}|��dS)z�
        Private API hook called when feeding data in the background thread
        raises an exception.  For overriding by concurrent.futures.
        rN)�	traceback�	print_exc)r�rNr�r)r)r*rwszQueue._on_queue_feeder_error�r)F�TN)�__name__�
__module__�__qualname__r+r/r2r$r#rQrYr\r_rbrdrfrgrirlrJ�staticmethodrzr}rvrwr)r)r)r*r#s2



!
	

>rc@s@eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Zd	S)rrcCs*tj|||d�|�d�|_|��|_dS)N)r(r)rr+�	Semaphore�_unfinished_tasksr8�_condr%r)r)r*r+(szJoinableQueue.__init__cCst�|�|j|jfSr,)rr/r�r�r.r)r)r*r/-szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr2r�r�r0r)r)r*r20szJoinableQueue.__setstate__TNc	Cs�|jrtd|�d���|j�||�st�|j�=|j�!|jdur%|��|j	�
|�|j��|j�
�Wd�n1s?wYWd�dSWd�dS1sWwYdSrG)r?rHr!rIrr5r�r<rJr;rKr�rRrLrMr)r)r*rQ4s

P�zJoinableQueue.putcCsf|j�&|j�d�std��|jj��r!|j��Wd�dSWd�dS1s,wYdS)NFz!task_done() called too many times)r�r�rIrHrZra�
notify_allr.r)r)r*�	task_doneAs�"�zJoinableQueue.task_donecCsR|j�|jj��s|j��Wd�dSWd�dS1s"wYdSr,)r�r�rZrar�r.r)r)r*r~Hs�"�zJoinableQueue.joinr�r�)	r�r�r�r+r/r2rQr�r~r)r)r)r*r&s


rc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
ej�Z
dS)rcCsJtjdd�\|_|_|��|_|jj|_tj	dkrd|_
dS|��|_
dS)NFrr)rrrrrrrErFrrr)r&r(r)r)r*r+Ss



zSimpleQueue.__init__cCs|j��|j��dSr,)rrgrr.r)r)r*rg\s
zSimpleQueue.closecCr]r,r^r.r)r)r*r_`r`zSimpleQueue.emptycCst�|�|j|j|j|jfSr,)r	r-rrrrr.r)r)r*r/cs
zSimpleQueue.__getstate__cCs"|\|_|_|_|_|jj|_dSr,)rrrrrErFr0r)r)r*r2gszSimpleQueue.__setstate__cCs:|j�
|j��}Wd�n1swYt�|�Sr,)rrrCrUrV)r&rWr)r)r*rYks�
zSimpleQueue.getcCs\t�|�}|jdur|j�|�dS|j�|j�|�Wd�dS1s'wYdSr,)rUr�rrrArer)r)r*rQqs

"�zSimpleQueue.putN)r�r�r�r+rgr_r/r2rYrQ�classmethod�types�GenericAlias�__class_getitem__r)r)r)r*rQs	
r)�__all__rrr7r9rSr�r{r��queuerr�_multiprocessing�rr	�	reduction�ForkingPicklerrU�utilr
rrr
r�objectrr�rrr)r)r)r*�<module>s(	z
+

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...