Your IP : 18.117.104.132


Current Path : /opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/multiprocessing/__pycache__/queues.cpython-312.opt-2.pyc

�

�Q�f�1���gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlZddl
mZddl
mZej j"ZddlmZmZmZmZmZGd�d	e�Ze�ZGd
�de�ZGd�d
e�Zy))�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc���eZdZdd�Zd�Zd�Zd�Zdd�Zdd�Zdd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zed��Zed��Zed��Zed��Zeej6�Zy)rc���|dkrddlm}||_tjd��\|_|_|j�|_tj�|_tjdk(rd|_n|j�|_|j|�|_d|_|j%�tjdk7rt'|t(j*�yy)Nrr)�
SEM_VALUE_MAXF��duplex�win32)�synchronizer�_maxsizer	�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlock�BoundedSemaphore�_sem�
_ignore_epipe�_resetrr�_after_fork��self�maxsize�ctxs   �=/opt/alt/python312/lib64/python3.12/multiprocessing/queues.py�__init__zQueue.__init__%s����a�<�=���
�%/�_�_�E�%B�"���d�l��h�h�j����Y�Y�[��
��<�<�7�"��D�K��(�(�*�D�K��(�(��1��	�"������
��<�<�7�"���e�&7�&7�8�#�c���tj|�|j|j|j|j
|j|j|j|jfS�N)
r
�assert_spawningr%rrrrr"r$r�r)s r,�__getstate__zQueue.__getstate__9sP������%��"�"�D�M�M�4�<�<�������T�[�[�$�)�)�T�Z�Z�A�	Ar.c	��|\|_|_|_|_|_|_|_|_|j�yr0)	r%rrrrr"r$rr&�r)�states  r,�__setstate__zQueue.__setstate__>s5��<A�	:��	�T�]�D�L�$�,�	
��d�k�4�9�d�j����
r.c�>�td�|jd��y)NzQueue._after_fork()T)�
after_fork)rr&r2s r,r'zQueue._after_forkCs��
�#�$����t��$r.c��|r|jj�n,tjtj��|_tj�|_d|_d|_	d|_
d|_d|_|jj|_|j j"|_|j j&|_y�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)r9s  r,r&zQueue._resetGs�����N�N�*�*�,�&�0�0����1A�B�D�N�"�(�(�*���������#����������<�<�2�2����<�<�2�2����\�\�&�&��
r.Nc�b�|jrtd|�d���|jj||�st�|j
5|j�|j�|jj|�|j
j�ddd�y#1swYyxYw�NzQueue z
 is closed)rF�
ValueErrorr$�acquirerr<rC�
_start_threadrB�append�notify�r)�obj�block�timeouts    r,�putz	Queue.putVs���<�<��v�d�X�Z�8�9�9��y�y� � ���0��J�
�^�^��|�|�#��"�"�$��L�L����$��N�N�!�!�#�	�^�^�s
�
AB%�%B.c���|jrtd|�d���|rB|�@|j5|j�}ddd�|jj�n�|rt
j�|z}|jj||�st�	|r.t
j�z
}|j|�st�|j�st�|j�}|jj�|jj�tj�S#1swY��xYw#|jj�wxYwrO)
rFrPrrKr$�release�time�	monotonicrQrrM�_ForkingPickler�loads)r)rWrX�res�deadlines     r,�getz	Queue.getbs
���<�<��v�d�X�Z�8�9�9��W�_�����&�&�(����I�I������>�>�+�g�5���;�;�&�&�u�g�6���

&��&����)9�9�G��:�:�g�.�#�������K��&�&�(���	�	�!�!�#����#�#�%��$�$�S�)�)�)���$���#�#�%�s�D;�A0E�;E�E#c�d�|j|jjj�z
Sr0)rr$�_semlock�
_get_valuer2s r,�qsizezQueue.qsize|s$���}�}�t�y�y�1�1�<�<�>�>�>r.c�$�|j�Sr0�rMr2s r,�emptyzQueue.empty�����:�:�<��r.c�J�|jjj�Sr0)r$rd�_is_zeror2s r,�fullz
Queue.full�s���y�y�!�!�*�*�,�,r.c�$�|jd�Sr;)rbr2s r,�
get_nowaitzQueue.get_nowait�s���x�x���r.c�&�|j|d�Sr;)rY�r)rVs  r,�
put_nowaitzQueue.put_nowait�s���x�x��U�#�#r.c�L�d|_|j}|rd|_|�yy)NT)rFrG)r)�closes  r,rtzQueue.close�s&�����������D�K��G�r.c�T�td�|jr|j�yy)NzQueue.join_thread())rrDr2s r,�join_threadzQueue.join_thread�s%��
�#�$��������r.c�|�td�d|_	|jj�y#t$rYywxYw)NzQueue.cancel_join_thread()T)rrErD�cancel�AttributeErrorr2s r,�cancel_join_threadzQueue.cancel_join_thread�s<��
�*�+�"���	����#�#�%���	��	�s�/�	;�;c���|jj�tjdk(r|jj�|j�|j�y)Nr)rrtr r!rrvr2s r,�_terminate_brokenzQueue._terminate_broken�sG��	
�������<�<�7�"��L�L��� ��
�
�����r.c�,�td�|jj�tjt
j|j|j|j|j|jj|jj|j|j|jf	dd��|_	td�|j j#�td�|j$sJt'|j t
j(t+j,|j �gd��|_t'|t
j0|j|jgd	��|_y#d|_�xYw)
NzQueue._start_thread()�QueueFeederThreadT)�target�args�name�daemonzdoing self._thread.start()z... done self._thread.start()���)�exitpriority�
)rrB�clearr>�Threadr�_feedr<rIr"rrtrr%�_on_queue_feeder_errorr$rC�startrEr
�_finalize_join�weakref�refrD�_finalize_closerGr2s r,rRzQueue._start_thread�s2��
�%�&�	
������ �'�'��;�;��,�,�����0@�0@��+�+�t�|�|�1�1�4�<�<�3E�3E��$�$�d�&A�&A��)�)��%��
���	��.�/��L�L��� ��1�2��"�"�'����e�2�2����T�\�\�*�+�� �D����%�'�'�
�\�\�4�>�>�*������	� �D�L��s�
0F	�	
Fc�z�td�|�}|�|j�td�ytd�y)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r�join)�twr�threads  r,r�zQueue._finalize_join�s3��
�$�%�������K�K�M��+�,��1�2r.c��td�|5|jt�|j�ddd�y#1swYyxYw)Nztelling queue thread to quit)rrS�	_sentinelrT)�buffer�notemptys  r,r�zQueue._finalize_close�s.��
�,�-�
��M�M�)�$��O�O���X�X�s	�&=�Ac	��td�|j}	|j}
|j}|j}t
}
tjdk7r|j}|j}nd}		|	�	|s|�|
�		|�}||
urtd�|�|�ytj|�}|�	||�n|�	||���]#|
�wxYw#�wxYw#t$rYnwxYwno#t$rc}|r#t|dd�tjk(rYd}~yt�rt!d|�Yd}~y|j�||�Yd}~nd}~wwxYw��)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)rrQr[�wait�popleftr�r r!r^�dumps�
IndexError�	Exception�getattrr��EPIPErr)r�r�rH�	writelock�reader_close�writer_close�ignore_epipe�onerror�	queue_sem�nacquire�nrelease�nwait�bpopleft�sentinel�wacquire�wreleaserV�es                  r,r�zQueue._feed�sh��	�4�5��#�#���#�#���
�
���>�>�����<�<�7�"� �(�(�H� �(�(�H��H��-
$��
��!����J���&�j���(�?�!�"I�J�(�N�(�N�"�.�3�3�C�8��#�+�&�s�O�$�J�+� *�3�� (�
�#���J��&!)�
��!��������
$��G�A�w��$:�e�k�k�$I��
�<��4�a�8���%�%�'��A�s�O�O��#
$��;sx�2D�:	C)�D�%D�1'D�C5�!D�)	C2�2D�5	C>�>D�	D
�
D�D
�
D�	E=� E8�?E8�E8�8E=c�.�	ddl}|j�y)Nr)�	traceback�	print_exc)r�rVr�s   r,r�zQueue._on_queue_feeder_error&s��	�	����r.�r)F�TN)�__name__�
__module__�__qualname__r-r3r7r'r&rYrbrfrirmrorrrtrvrzr|rR�staticmethodr�r�r�r��classmethod�types�GenericAlias�__class_getitem__�r.r,rr#s���9�(A�
�
%�
'�
$�*�4?� �-��$�����%�N�3��3������<$��<$�|����$�E�$6�$6�7�r.rc�4�eZdZdd�Zd�Zd�Zd	d�Zd�Zd�Zy)
rc��tj|||��|jd�|_|j	�|_y)N)r+r)rr-�	Semaphore�_unfinished_tasksr?�_condr(s   r,r-zJoinableQueue.__init__>s2��
���t�W�#��.�!$���q�!1����]�]�_��
r.c�^�tj|�|j|jfzSr0)rr3r�r�r2s r,r3zJoinableQueue.__getstate__Cs'���!�!�$�'�4�:�:�t�7M�7M�*N�N�Nr.c�Z�tj||dd�|dd\|_|_y)N���)rr7r�r�r5s  r,r7zJoinableQueue.__setstate__Fs-��
���4��s���,�-2�2�3�Z�*��
�D�*r.Nc���|jrtd|�d���|jj||�st�|j
5|j5|j�|j�|jj|�|jj�|j
j�ddd�ddd�y#1swY�xYw#1swYyxYwrO)rFrPr$rQrr<r�rCrRrBrSr�r[rTrUs    r,rYzJoinableQueue.putJs����<�<��v�d�X�Z�8�9�9��y�y� � ���0��J�
�^�^�T�Z�Z��|�|�#��"�"�$��L�L����$��"�"�*�*�,��N�N�!�!�#�(�^�^�Z�Z��^�^�s%�

C �A,C�C �C	�C � C)c��|j5|jjd�std��|jjj�r|jj
�ddd�y#1swYyxYw)NFz!task_done() called too many times)r�r�rQrPrdrl�
notify_allr2s r,�	task_donezJoinableQueue.task_doneWs[��
�Z�Z��)�)�1�1�%�8� �!D�E�E��%�%�.�.�7�7�9��
�
�%�%�'�	�Z�Z�s�A%A;�;Bc���|j5|jjj�s|jj	�ddd�y#1swYyxYwr0)r�r�rdrlr�r2s r,r�zJoinableQueue.join^s9��
�Z�Z��)�)�2�2�;�;�=��
�
���!��Z�Z�s�?A�Ar�r�)	r�r�r�r-r3r7rYr�r�r�r.r,rr<s!��%�
O�8�$�(�"r.rc�Z�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
ej�Z
y)	rc�
�tjd��\|_|_|j	�|_|jj|_tjdk(rd|_
y|j	�|_
y)NFrr)r	rrrrrrLrMr r!r")r)r+s  r,r-zSimpleQueue.__init__isW��%/�_�_�E�%B�"���d�l��h�h�j����\�\�&�&��
��<�<�7�"��D�K��(�(�*�D�Kr.c�l�|jj�|jj�yr0)rrtrr2s r,rtzSimpleQueue.closers"�������������r.c�$�|j�Sr0rhr2s r,rizSimpleQueue.emptyvrjr.c��tj|�|j|j|j|j
fSr0)r
r1rrrr"r2s r,r3zSimpleQueue.__getstate__ys/������%����d�l�l�D�K�K����E�Er.c�p�|\|_|_|_|_|jj|_yr0)rrrr"rLrMr5s  r,r7zSimpleQueue.__setstate__}s)��AF�>���t�|�T�[�$�+��\�\�&�&��
r.c��|j5|jj�}ddd�tj	�S#1swY�xYwr0)rrrJr^r_)r)r`s  r,rbzSimpleQueue.get�s;��
�[�[��,�,�)�)�+�C���$�$�S�)�)��[�s�A�Ac��tj|�}|j�|jj	|�y|j5|jj	|�ddd�y#1swYyxYwr0)r^r�r"rrHrqs  r,rYzSimpleQueue.put�sQ���#�#�C�(���;�;���L�L�#�#�C�(�������'�'��,����s�
A/�/A8N)r�r�r�r-rtrir3r7rbrYr�r�r�r�r�r.r,rrgs9��%�� �F�'�*�-�$�E�$6�$6�7�r.r)�__all__r rr>r@r\r�r�r��queuerr�_multiprocessing�r	r
�	reduction�ForkingPicklerr^�utilrrr
rr�objectrr�rrr�r.r,�<module>r�sx��4��
�	������������#�#�2�2��H�H�L8�F�L8�^
�H�	�%"�E�%"�V*8�&�*8r.

?>