AlkantarClanX12

Your IP : 18.117.78.215


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

�

c��f\(����ddlZddlZddlZddlZddlZddlmZddlmZgd�Ze	ed��Z
ejejfZ
dd�iZejd	krLddlZddlZe	ed
��re�deji��e�deji��Gd
�de��ZGd�de��Ze��ZejZejZejZejZd�ZdS)�N�)�spawn)�util)�ensure_running�register�
unregister�pthread_sigmask�noopc��dS�N�r
��G/opt/alt/python311/lib64/python3.11/multiprocessing/resource_tracker.py�<lambda>r!s��D�r�posix�
sem_unlink�	semaphore�
shared_memoryc��eZdZdS)�ReentrantCallErrorN)�__name__�
__module__�__qualname__r
rrrr6s�������Drrc�D�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
S)�ResourceTrackerc�R�tj��|_d|_d|_dSr)�	threading�RLock�_lock�_fd�_pid��selfs r�__init__zResourceTracker.__init__<s#���_�&�&��
������	�	�	rc� �td���)Nz8Reentrant call into the multiprocessing resource tracker)rr"s r�_reentrant_call_errorz%ResourceTracker._reentrant_call_errorAs��
!�F�H�H�	Hrc�l�|j5|j���dkr |���cddd��S|j�	ddd��dSt	j|j��d|_t	j|jd��d|_ddd��dS#1swxYwYdS)Nrr)r�_recursion_countr&r �os�close�waitpidr!r"s r�_stopzResourceTracker._stopIs+��
�Z�	�	��z�*�*�,�,�q�0�0��1�1�3�3�		�	�	�	�	�	�	�	�
�x���	�	�	�	�	�	�	�	�
�H�T�X�����D�H��J�t�y�!�$�$�$��D�I�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�1B)�B)�AB)�)B-�0B-c�8�|���|jSr)rr r"s r�getfdzResourceTracker.getfdZs���������x�rc�,�|j5|j���dkr |���cddd��S|j��|���r	ddd��dStj|j��	|j�tj|jd��n#t$rYnwxYwd|_d|_tjd��g}	|�tj�����n#t $rYnwxYwd}tj��\}}	|�|��t%j��}|gt)j��z}|d||zgz
}	t,r$t/jt.jt4��t)j|||��}t,r$t/jt.jt4��n1#t,r%t/jt.jt4��wwxYw||_||_n#tj|���xYw	tj|��n#tj|��wxYw	ddd��dS#1swxYwYdS)z�Make sure that resource tracker process is running.

        This can be run from any process.  Usually a child process will use
        the resource created by its parent.rNrzUresource_tracker: process died unexpectedly, relaunching.  Some resources might leak.z:from multiprocessing.resource_tracker import main;main(%d)z-c)rr(r&r �_check_aliver)r*r!r+�ChildProcessError�warnings�warn�append�sys�stderr�fileno�	Exception�piper�get_executabler�_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr	�	SIG_BLOCK�_IGNORED_SIGNALS�spawnv_passfds�SIG_UNBLOCK)r#�fds_to_pass�cmd�r�w�exe�args�pids        rrzResourceTracker.ensure_running^s��
�Z�<	�<	��z�*�*�,�,�q�0�0��1�1�3�3�<	�<	�<	�<	�<	�<	�<	�<	��x�#��$�$�&�&���<	�<	�<	�<	�<	�<	�<	�<	�����"�"�"���y�,��
�4�9�a�0�0�0���(�����D����� ��� ��	��
�I�J�J�J��K�
��"�"�3�:�#4�#4�#6�#6�7�7�7�7���
�
�
���
����N�C��7�9�9�D�A�q�
��"�"�1�%�%�%��*�,�,���u�t�@�B�B�B����s�Q�w��'��U�$�S��.�v�/?�AQ�R�R�R��-�c�4��E�E�C�$�U��.�v�/A�CS�T�T�T���%�U��.�v�/A�CS�T�T�T�T�U���������	�	��
�������������������������������y<	�<	�<	�<	�<	�<	�<	�<	�<	�<	�<	�<	����<	�<	�<	�<	�<	�<	s��1J	�J	�/J	�	!B+�*J	�+
B8�5J	�7B8�8'J	� 1D�J	�
D�J	�D�J	�;A	H2�AG2�,H2�2.H � H2�#I"�2I	�	I"�
J	�"I8�8J	�	J
�J
c�^�	tj|jd��dS#t$rYdSwxYw)z;Check that the pipe has not been closed by sending a probe.s
PROBE:0:noop
TF)r)�writer �OSErrorr"s rr0zResourceTracker._check_alive�sI��	�
�H�T�X�0�1�1�1��4���	�	�	��5�5�	���s��
,�,c�4�|�d||��dS)z0Register name of resource with resource tracker.�REGISTERN��_send�r#�name�rtypes   rrzResourceTracker.register�s���
�
�:�t�U�+�+�+�+�+rc�4�|�d||��dS)z2Unregister name of resource with resource tracker.�
UNREGISTERNrNrPs   rrzResourceTracker.unregister�s���
�
�<��u�-�-�-�-�-rc���	|���n+#t$rtjd|�d|�d���YnwxYwd�|||���d��}t
|��dkrtd���tj	|j
|��}|t
|��ks+Jd�|t
|�������dS)	NzSResourceTracker called reentrantly for resource cleanup, which is unsupported. The z object z might leak.z{0}:{1}:{2}
�asciiizmsg too longznbytes {0:n} but len(msg) {1:n})rrr2r3�format�encode�len�
ValueErrorr)rJr )r#rCrQrR�msg�nbytess      rrOzResourceTracker._send�s��
	<����!�!�!�!��!�	<�	<�	<�

�M�;��;�;�&*�;�;�;�
<�
<�
<�
<�
<�	<�����$�$�S�$��6�6�=�=�g�F�F���s�8�8�c�>�>��^�,�,�,���$�(�C�(�(����S���!�!�!�#D�#K�#K��C��H�H�$�$�!�!�!�!�!s��%?�?N)rrrr$r&r,r.rr0rrrOr
rrrr:s����������
H�H�H����"���A�A�A�F	�	�	�,�,�,�.�.�.�����rrc���tjtjtj��tjtjtj��tr$tjtjt��tj	tj
fD]'}	|����#t$rY�$wxYwd�t���D��}	t|d��5}|D�]	}	|����d���d��\}}}t�|d��}|�t)d|�d|�����|dkr||�|��n;|d	kr||�|��n|d
krnt/d|z�����#t$r,	tjtj���n#YnxYwY��wxYw	ddd��n#1swxYwY|���D]�\}}|r8	t7jdt;|��|fz��n#t$rYnwxYw|D]P}		t||��n1#t$r$}	t7jd
|�d|	����Yd}	~	nd}	~	wwxYw�L#wxYw��dS#|���D]�\}}|r8	t7jdt;|��|fz��n#t$rYnwxYw|D]P}		t||��n1#t$r$}	t7jd
|�d|	����Yd}	~	nd}	~	wwxYw�L#wxYw��wxYw)zRun resource tracker.c�,�i|]}|t����Sr
)�set)�.0rRs  r�
<dictcomp>zmain.<locals>.<dictcomp>�s��=�=�=�e�U�C�E�E�=�=�=r�rbrV�:NzCannot register z. for automatic cleanup: unknown resource type rMrT�PROBEzunrecognized command %rzQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: z: )r=�SIGINT�SIG_IGN�SIGTERMr<r	rAr?r5�stdin�stdoutr*r8�_CLEANUP_FUNCS�keys�open�strip�decode�split�getrZ�add�remove�RuntimeError�
excepthook�exc_info�itemsr2r3rY)
�fd�f�cache�linerCrQrR�cleanup_func�rtype_cache�es
          r�mainr~�s����M�&�-���0�0�0�
�M�&�.�&�.�1�1�1��E���v�1�3C�D�D�D��i���
$����	�
�G�G�I�I�I�I���	�	�	��D�	����
>�=�~�':�':�'<�'<�=�=�=�E�-�
�"�d�^�^�	�q��
�
���'+�z�z�|�|�':�':�7�'C�'C�'I�'I�#�'N�'N�$�C��u�#1�#5�#5�e�T�#B�#B�L�#�+�(�=�t�=�=�5:�=�=�>�>�>��j�(�(��e��(�(��.�.�.�.���,�,��e��+�+�D�1�1�1�1������*�+D�s�+J�K�K�K��� �����������7�7�7����������	����#
�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�2#(�+�+�-�-�	�	��E�;��
���M�#N�#&�{�#3�#3�U�";�#<�=�=�=�=��!�����D�����#�

�

���N�&�u�-�d�3�3�3�3��$�N�N�N� �
�
�D�D�D�!�!�&L�M�M�M�M�M�M�M�M�����N������D�D�D�D�

�	�	��%�+�+�-�-�	�	��E�;��
���M�#N�#&�{�#3�#3�U�";�#<�=�=�=�=��!�����D�����#�

�

���N�&�u�-�d�3�3�3�3��$�N�N�N� �
�
�D�D�D�!�!�&L�M�M�M�M�M�M�M�M�����N������D�D�D�D�

�	���s!�B.�.
B;�:B;�"K�2H
�9C
G�H
�
G=�G2�1G=�2G6	�4G=�9H
�<G=�=H
�K�
H�K�H�K�4&I�
I(�'I(�1J�J9�
J5�J0�+J9�0J5�5J9�9J;�M*�&L�M*�
L	�M*�L	�M*�L1�0M#�1
M�;M�M#�M�M#�"M*�#M%�%M*)r)r=r5rr2�rr�__all__�hasattrr<rergr?rjrQ�_multiprocessing�_posixshmem�updater�
shm_unlinkrsr�objectr�_resource_trackerrrrr.r~r
rr�<module>r�s���$
�	�	�	�
�
�
�
�
�
�
�
���������������������
6�
6�
6����� 1�2�2�
��M�6�>�2���L�L����7�g������������w���.�.������)�4�
�	�	�	������/�����
	�	�	�	�	��	�	�	�M�M�M�M�M�f�M�M�M�`$�O�%�%��"�1���%��
�
)�
����<�<�<�<�<r