ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/queues.cpython-311.pyc

�

�f�.���gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlZddl
mZddl
mZejjZddlmZmZmZmZmZGd�d	e��Ze��ZGd
�de��ZGd�d
e��ZdS))�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�Zed���Zed���Zed���Zed���Zd	S)rrc��|dkrddlm}||_tjd���\|_|_|���|_tj
��|_tj
dkrd|_n|���|_|�|��|_d|_|���tj
dkrt'|t(j��dSdS)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/python311/lib64/python3.11/multiprocessing/queues.py�__init__zQueue.__init__%s����a�<�<�=�=�=�=�=�=���
�%/�_�E�%B�%B�%B�"���d�l��h�h�j�j����Y�[�[��
��<�7�"�"��D�K�K��(�(�*�*�D�K��(�(��1�1��	�"������
�
�
��<�7�"�"���e�&7�8�8�8�8�8�#�"�c��tj|��|j|j|j|j|j|j|j|j	fS�N)
r
�assert_spawningr%rrrrr"r$r�r)s r,�__getstate__zQueue.__getstate__9sB�����%�%�%��"�D�M�4�<�����T�[�$�)�T�Z�A�	Ar.c	��|\|_|_|_|_|_|_|_|_|���dSr0)	r%rrrrr"r$rr&�r)�states  r,�__setstate__zQueue.__setstate__>s=��<A�	:��	�T�]�D�L�$�,�	
��d�k�4�9�d�j����
�
�
�
�
r.c�P�td��|�d���dS)NzQueue._after_fork()T)�
after_fork)rr&r2s r,r'zQueue._after_forkCs+��
�#�$�$�$����t��$�$�$�$�$r.Fc�n�|r|j���n*tjtj����|_tj��|_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)r9s  r,r&zQueue._resetGs����	C��N�*�*�,�,�,�,�&�0���1A�1A�B�B�D�N�"�(�*�*���������#����������<�2����<�2����\�&��
�
�
r.TNc�Z�|jrtd|�d����|j�||��st�|j5|j�|���|j�	|��|j�
��ddd��dS#1swxYwYdS�NzQueue z
 is closed)rF�
ValueErrorr$�acquirerr<rC�
_start_threadrB�append�notify�r)�obj�block�timeouts    r,�putz	Queue.putVs����<�	:��8�d�8�8�8�9�9�9��y� � ���0�0�	��J�
�^�	$�	$��|�#��"�"�$�$�$��L����$�$�$��N�!�!�#�#�#�		$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	$�	$s�AB � B$�'B$c���|jrtd|�d����|rO|�M|j5|���}ddd��n#1swxYwY|j���n�|rt
j��|z}|j�||��st�	|r3|t
j��z
}|�
|��st�n|�
��st�|���}|j���|j���n#|j���wxYwt�|��SrO)
rFrPrrKr$�release�time�	monotonicrQrrM�_ForkingPickler�loads)r)rWrX�res�deadlines     r,�getz	Queue.getbs����<�	:��8�d�8�8�8�9�9�9��	&�W�_���
)�
)��&�&�(�(��
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)��I��������
6��>�+�+�g�5���;�&�&�u�g�6�6�
���

&�� �&���)9�)9�9�G��:�:�g�.�.�$�#��$������ ��K��&�&�(�(���	�!�!�#�#�#���#�#�%�%�%�%����#�#�%�%�%�%�����$�$�S�)�)�)s�A�A�A�'A=D>�>Ec�N�|j|jj���z
Sr0)rr$�_semlock�
_get_valuer2s r,�qsizezQueue.qsize|s ���}�t�y�1�<�<�>�>�>�>r.c�,�|���Sr0�rMr2s r,�emptyzQueue.empty�����:�:�<�<��r.c�>�|jj���Sr0)r$rd�_is_zeror2s r,�fullz
Queue.full�s���y�!�*�*�,�,�,r.c�,�|�d��Sr;)rbr2s r,�
get_nowaitzQueue.get_nowait�s���x�x����r.c�.�|�|d��Sr;)rY�r)rVs  r,�
put_nowaitzQueue.put_nowait�s���x�x��U�#�#�#r.c�L�d|_|j}|rd|_|��dSdS)NT)rFrG)r)�closes  r,rtzQueue.close�s8���������	��D�K��E�G�G�G�G�G�	�	r.c��td��|jsJd�|�����|jr|���dSdS)NzQueue.join_thread()zQueue {0!r} not closed)rrF�formatrDr2s r,�join_threadzQueue.join_thread�sb��
�#�$�$�$��|�B�B�5�<�<�T�B�B�B�B�|���	���������	�	r.c��td��d|_	|j���dS#t$rYdSwxYw)NzQueue.cancel_join_thread()T)rrErD�cancel�AttributeErrorr2s r,�cancel_join_threadzQueue.cancel_join_thread�s[��
�*�+�+�+�"���	���#�#�%�%�%�%�%���	�	�	��D�D�	���s�3�
A�Ac��td��|j���tjt
j|j|j|j|j	|j
j|jj|j
|j|jf	d���|_d|j_td��|j���td��|js?t)|jt
jt-j|j��gd���|_t)|t
j|j|jgd	���|_dS)
NzQueue._start_thread()�QueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)�exitpriority�
)rrB�clearr>�Threadr�_feedr<rIr"rrtrr%�_on_queue_feeder_errorr$rC�daemon�startrEr
�_finalize_join�weakref�refrD�_finalize_closerGr2s r,rRzQueue._start_thread�s2��
�%�&�&�&�	
������� �'��;��,����0@��+�t�|�1�4�<�3E��$�d�&A��)��%�

�
�
���#����
�*�+�+�+��������
�-�.�.�.��"�	�'���e�2���T�\�*�*�+�� � � �D����%�'�
�\�4�>�*��������r.c��td��|��}|�%|���td��dStd��dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r�join)�twr�threads  r,r�zQueue._finalize_join�sY��
�$�%�%�%���������K�K�M�M�M��+�,�,�,�,�,��1�2�2�2�2�2r.c��td��|5|�t��|���ddd��dS#1swxYwYdS)Nztelling queue thread to quit)rrS�	_sentinelrT)�buffer�notemptys  r,r�zQueue._finalize_close�s���
�,�-�-�-�
�	�	��M�M�)�$�$�$��O�O����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�/A�A�Ac	�T�td��|j}	|j}
|j}|j}t
}
tjdkr|j}|j}nd}		|	��	|s
|��|
��n#|
��wxYw		|��}||
ur%td��|��|��dSt�	|��}|�||��n0|��	||��|��n#|��wxYw��#t$rYnwxYwn�#t$ru}|r%t|dd��tjkrYd}~dSt��rt!d|��Yd}~dS|���|||��Yd}~nd}~wwxYw��U)Nz$starting thread to feed data to piperrz%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�s$��	�4�5�5�5��#���#���
���>�����<�7�"�"� �(�H� �(�H�H��H�.	$�-
$���
�
�
��!� �������H�J�J�J�J��H�H�J�J�J�J�����+�&�h�j�j���(�?�?�!�"I�J�J�J�(�L�N�N�N�(�L�N�N�N�"�F�.�3�3�C�8�8��#�+�&�J�s�O�O�O�O�$�H�J�J�J�+� *�
�3���� (��
�
�
�
����
�
�
�
����#+��$"�����D��������
$�
$�
$���G�A�w��$:�$:�e�k�$I�$I��F�F�F�F�F�
�<�<�
$��4�a�8�8�8��F�F�F�F�F��%�%�'�'�'��G�A�s�O�O�O�O�O�O�O�O�����#
$����;.	$sx�
D&�!A8�-D&�8B�D&�2D�<2D�/D�:D�D�D�
D"�D&�!D"�"D&�&
F%�0!F �F �; F � F%c�6�ddl}|���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�rVr�s   r,r�zQueue._on_queue_feeder_errors(��	�����������r.�r)F�TN)�__name__�
__module__�__qualname__r-r3r7r'r&rYrbrfrirmrorrrtrwr{rR�staticmethodr�r�r�r��r.r,rr#s�������9�9�9�9�(A�A�A�
���
%�%�%�
'�
'�
'�
'�
$�
$�
$�
$�*�*�*�*�4?�?�?� � � �-�-�-����$�$�$�������������B�3�3��\�3�����\���<$�<$��\�<$�|����\���r.rc�6�eZdZd
d�Zd�Zd�Zdd�Zd�Zd	�ZdS)rrc��t�|||���|�d��|_|���|_dS)N)r+r)rr-�	Semaphore�_unfinished_tasksr?�_condr(s   r,r-zJoinableQueue.__init__(sA��
���t�W�#��.�.�.�!$���q�!1�!1����]�]�_�_��
�
�
r.c�T�t�|��|j|jfzSr0)rr3r�r�r2s r,r3zJoinableQueue.__getstate__-s%���!�!�$�'�'�4�:�t�7M�*N�N�Nr.c�z�t�||dd���|dd�\|_|_dS)N���)rr7r�r�r5s  r,r7zJoinableQueue.__setstate__0s=��
���4��s��s��,�,�,�-2�2�3�3�Z�*��
�D�*�*�*r.TNc���|jrtd|�d����|j�||��st�|j5|j5|j�|���|j	�
|��|j���|j�
��ddd��n#1swxYwYddd��dS#1swxYwYdSrO)rFrPr$rQrr<r�rCrRrBrSr�r[rTrUs    r,rYzJoinableQueue.put4sf���<�	:��8�d�8�8�8�9�9�9��y� � ���0�0�	��J�
�^�	$�	$�T�Z�	$�	$��|�#��"�"�$�$�$��L����$�$�$��"�*�*�,�,�,��N�!�!�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�	$�	$s7�C�A(C�4C�C	�C�C	�C�C�Cc��|j5|j�d��std���|jj���r|j���ddd��dS#1swxYwYdS)NFz!task_done() called too many times)r�r�rQrPrdrl�
notify_allr2s r,�	task_donezJoinableQueue.task_doneAs���
�Z�	(�	(��)�1�1�%�8�8�
F� �!D�E�E�E��%�.�7�7�9�9�
(��
�%�%�'�'�'�		(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s�A!A6�6A:�=A:c��|j5|jj���s|j���ddd��dS#1swxYwYdSr0)r�r�rdrlr�r2s r,r�zJoinableQueue.joinHs���
�Z�	"�	"��)�2�;�;�=�=�
"��
���!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�	"�	"s�8A
�
A�Ar�r�)	r�r�r�r-r3r7rYr�r�r�r.r,rr&s{������%�%�%�%�
O�O�O�8�8�8�$�$�$�$�(�(�(�"�"�"�"�"r.rc�X�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
ej��Z
dS)	rc��tjd���\|_|_|���|_|jj|_tj	dkr	d|_
dS|���|_
dS)NFrr)r	rrrrrrLrMr r!r")r)r+s  r,r-zSimpleQueue.__init__Ssc��%/�_�E�%B�%B�%B�"���d�l��h�h�j�j����\�&��
��<�7�"�"��D�K�K�K��(�(�*�*�D�K�K�Kr.c�j�|j���|j���dSr0)rrtrr2s r,rtzSimpleQueue.close\s0�����������������r.c�,�|���Sr0rhr2s r,rizSimpleQueue.empty`rjr.c�^�tj|��|j|j|j|jfSr0)r
r1rrrr"r2s r,r3zSimpleQueue.__getstate__cs*�����%�%�%���d�l�D�K���E�Er.c�^�|\|_|_|_|_|jj|_dSr0)rrrr"rLrMr5s  r,r7zSimpleQueue.__setstate__gs(��AF�>���t�|�T�[�$�+��\�&��
�
�
r.c��|j5|j���}ddd��n#1swxYwYt�|��Sr0)rrrJr^r_)r)r`s  r,rbzSimpleQueue.getks���
�[�	,�	,��,�)�)�+�+�C�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,��$�$�S�)�)�)s�.�2�2c���t�|��}|j�|j�|��dS|j5|j�|��ddd��dS#1swxYwYdSr0)r^r�r"rrHrqs  r,rYzSimpleQueue.putqs����#�#�C�(�(���;���L�#�#�C�(�(�(�(�(���
-�
-���'�'��,�,�,�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-����
-�
-�
-�
-�
-�
-s�A-�-A1�4A1N)r�r�r�r-rtrir3r7rbrY�classmethod�types�GenericAlias�__class_getitem__r�r.r,rrQs�������%�%�%���� � � �F�F�F�'�'�'�*�*�*�-�-�-�$��E�$6�7�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�s|��4�
3�
3��
�
�
�
�	�	�	�	��������������������������������������������������#�2��H�H�H�H�H�H�H�H�H�H�H�H�H�H�v�v�v�v�v�F�v�v�v�r
�F�H�H�	�%"�%"�%"�%"�%"�E�%"�%"�%"�V*8�*8�*8�*8�*8�&�*8�*8�*8�*8�*8r.

Zerion Mini Shell 1.0