Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/util.cpython-311.pyc
�

�,d�6��N�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	gd�Z
dZdZdZ
dZd	Zd
ZdZdadad
�Zd�Zd�Zd�Zd�Zd*d�Zd�Zd�Ze��Zd�Zd�Zej��Z ej!��Z"d�Z#d�Z$iZ%ej!��Z&Gd�de'��Z(d*d�Z)d�Z*da+eee)e	j,e	j-fd�Z.ej/e.��Gd�de'��Z0Gd �d!ej1��Z2	ej3d"��Z4n
#e5$rd#Z4YnwxYwd$�Z6d%�Z7d&�Z8d'�Z9d(�Z:d)�Z;dS)+�N)�_args_from_interpreter_flags�)�process)�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFc�H�trtjt|g|�R�dSdS�N)�_logger�logr��msg�argss  �;/opt/alt/python311/lib64/python3.11/multiprocessing/util.pyrr,s4���*���H�c�)�D�)�)�)�)�)�)�*�*�c�H�trtjt|g|�R�dSdSr)rr�DEBUGrs  r!rr0s4���'���E�3�&��&�&�&�&�&�&�'�'r"c�H�trtjt|g|�R�dSdSr)rr�INFOrs  r!rr4s4���&���D�#�%��%�%�%�%�%�%�&�&r"c�H�trtjt|g|�R�dSdSr)rrrrs  r!r	r	8s4���,���J��+�d�+�+�+�+�+�+�,�,r"c�$�ddl}|���	ts�|�t��adt_t
td��r3tjt��tj
t��nNtj�tdif��tj�
tdif��|���n#|���wxYwtS)z0
    Returns logger used by multiprocessing
    rN�
unregister�)�logging�_acquireLockr�	getLogger�LOGGER_NAME�	propagate�hasattr�atexitr)�_exit_function�register�
_exithandlers�remove�append�_releaseLock)r+s r!r
r
<s���
�N�N�N���������	F��'�'��4�4�G� !�G���v�|�,�,�
F��!�.�1�1�1����/�/�/�/��$�+�+�^�R��,D�E�E�E��$�+�+�^�R��,D�E�E�E�	�������������������Ns�CC2�2Dc��ddl}t��}|�t��}|���}|�|��|�|��|r|�|��datS)zB
    Turn on logging and add a handler which prints to stderr
    rNT)
r+r
�	Formatter�DEFAULT_LOGGING_FORMAT�
StreamHandler�setFormatter�
addHandler�setLevel�_log_to_stderrr)�levelr+�logger�	formatter�handlers     r!rrWs���
�N�N�N�
�\�\�F��!�!�"8�9�9�I��#�#�%�%�G�����#�#�#�
���g��������������N��Nr"c�X�tjdkrdSttd��rdSdS)N�linuxT�getandroidapilevelF)�sys�platformr0r*r"r!�#_platform_supports_abstract_socketsrIls1��
�|�w����t��s�(�)�)���t��5r"c��|sdSt|t��r|ddkSt|t��r|ddkStd|�d����)NFr�zaddress type of z
 unrecognized)�
isinstance�bytes�str�	TypeError)�addresss r!�is_abstract_socket_namespacerQtsj�����u��'�5�!�!�"��q�z�Q���	�G�S�	!�	!�"��q�z�T�!�!�
�?�w�?�?�?�
@�
@�@r"c�^�||��tj��}|�d|jd<dSdS)N�tempdir)r�current_process�_config)�rmtreerSrTs   r!�_remove_temp_dirrW�s@��
�F�7�O�O�O��-�/�/�O��"�-1���	�*�*�*�#�"r"c�0�tj��j�d��}|�hddl}ddl}|�d���}td|��tdt|j
|fd���|tj��jd<|S)NrSrzpymp-)�prefixzcreated temp directory %si����)r �exitpriority)rrTrU�get�shutil�tempfile�mkdtemprrrWrV)rSr\r]s   r!rr�s����%�'�'�/�3�3�I�>�>�G������������"�"�'�"�2�2���
(�'�2�2�2�	��'�v�}�g�.F�"�	$�	$�	$�	$�7>���!�!�)�)�4��Nr"c��tt�����}|���|D]<\\}}}}	||���#t$r}td|��Yd}~�5d}~wwxYwdS)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rb�index�ident�func�obj�es      r!�_run_after_forkersrj�s����$�*�*�,�,�-�-�E�	�J�J�L�L�L�%*�8�8�!����t�c�	8��D��I�I�I�I���	8�	8�	8��3�Q�7�7�7�7�7�7�7�7�����	8����8�8s�A�
A7�A2�2A7c�^�|ttt��t|��|f<dSr)ra�next�_afterfork_counter�id)rhrgs  r!r
r
�s)��EH���0�1�1�2�c�7�7�D�A�B�B�Br"c�F�eZdZdZd	d�Zdeeejfd�Z	d�Z
d�Zd�ZdS)
rzA
    Class which supports object finalization using weakrefs
    r*Nc��|�Et|t��s0td�|t	|�������|�tj||��|_n|�td���||_	||_
|pi|_|tt��f|_tj��|_|t$|j<dS)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)rL�intrO�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrl�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrh�callbackr �kwargsrZs      r!�__init__zFinalize.__init__�s����$�j��c�.J�.J�$��E�L�L� �$�|�"4�"4�6�6�7�7�
7��?�#�K��T�2�2�D�M�M�
�
!��J�K�K�K�!�����
��|����!�4�(:�#;�#;�<��	��I�K�K��	�)-��D�I�&�&�&r"c�@�	||j=|j|��kr|d��d}n4|d|j|j|j��|j|ji|j��}dx|_x|_x|_x|_|_|S#t$r|d��YdSwxYw)zQ
        Run the callback unless it has already been called or cancelled
        z+finalizer ignored because different processNz/finalizer calling %s with args %s and kwargs %szfinalizer no longer registered)r|rrxryrzrv�KeyError)r��wrr�rr~�ress      r!�__call__zFinalize.__call__�s���	�#�D�I�.��y�F�F�H�H�$�$��	�G�H�H�H�����	�K��.�$�*�d�l�D�D�D�$�d�n�d�j�A�D�L�A�A��7;�
<�D�M�
<�D�N�
<�T�Z�
<� �L�4�9��J���	8�	8�	8��I�6�7�7�7�7�7�7�	8���s�B�B�Bc��	t|j=dx|_x|_x|_x|_|_dS#t$rYdSwxYw)z3
        Cancel finalization of the object
        N)r�r|rvrxryrzr��r�s r!�cancelzFinalize.cancel�sg��	<�#�D�I�.�
8<�
<�D�M�
<�D�N�
<�T�Z�
<� �L�4�9�9�9��	�	�	�	��D�D�	���s�
4�
A�Ac��|jtvS)zS
        Return whether this finalizer is still waiting to invoke callback
        )r|r�r�s r!�still_activezFinalize.still_active�s���y�/�/�/r"c��	|���}n#ttf$rd}YnwxYw|�d|jjzSd|jj�dt|jd|j����}|jr|dt|j��zz
}|j	r|dt|j	��zz
}|j
d� |dt|j
d��zz
}|d	zS)
Nz<%s object, dead>�<z object, callback=�__name__z, args=z	, kwargs=rz, exitpriority=�>)rv�AttributeErrorrO�	__class__r��getattrrxryrNrzr|)r�rh�xs   r!�__repr__zFinalize.__repr__�s��	��-�-�/�/�C�C���	�*�	�	�	��C�C�C�	�����;�&���)@�@�@����'�'�'����
�D�N�C�C�C�
E���:�	-�
��S���_�_�,�,�A��<�	1�
��s�4�<�0�0�0�0�A��9�Q�<�#�
�"�S���1��%6�%6�6�6�A��3�w�s��-�-)r*NN)
r��
__module__�__qualname__�__doc__r�r�rr}r~r�r�r�r�r*r"r!rr�s���������.�.�.�.�&�&9�$�R�Y�	����0
<�
<�
<�0�0�0�����r"rc����t�dS��d��n�fd���fd�tt��D��}|�d���|D]b}t�|��}|�Dt	d|��	|���:#t
$rddl}|���Y�^wxYw�c��t���dSdS)	z�
    Run all finalizers whose exit priority is not None and at least minpriority

    Finalizers with highest priority are called first; finalizers with
    the same priority will be called in reverse order of creation.
    Nc��|dduS�Nrr*)�ps r!�<lambda>z!_run_finalizers.<locals>.<lambda>s��q��t�4�'�r"c�0��|dduo|d�kSr�r*)r��minprioritys �r!r�z!_run_finalizers.<locals>.<lambda>s���q��t�4�'�?�A�a�D�K�,?�r"c�*��g|]}�|���
|��Sr*r*)�.0�key�fs  �r!�
<listcomp>z#_run_finalizers.<locals>.<listcomp>#s&���?�?�?�C���#���?�C�?�?�?r"T)�reversez
calling %sr)	r�r`rcr[rrd�	traceback�	print_exc�clear)r��keysr��	finalizerr�r�s`    @r!�_run_finalizersr�s �����"�	����'�'���?�?�?�?��@�?�?�?�4� 3�4�4�?�?�?�D��I�I�d�I�����	&�	&��'�+�+�C�0�0�	�� ��l�I�.�.�.�
&��	�������
&�
&�
&� � � � ��#�#�%�%�%�%�%�
&����	!����!�!�#�#�#�#�#��s�>
B	�	"B.�-B.c�"�tptduS)z6
    Returns true if the process is shutting down
    N)�_exitingr*r"r!rr8s���'�x�4�'�'r"c�|�ts�da|d��|d��|d��|���p|��D]3}|jr*|d|j��|j����4|��D]'}|d|j��|����(|d��|��dSdS)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r��daemon�name�_popen�	terminate�join)rrr��active_childrenrTr�s      r!r2r2@s��������
$�%�%�%�
��B�C�C�C��������?���(�%�_�&�&�
)�
)���8�)��D�<�a�f�E�E�E��H�&�&�(�(�(��$�_�&�&�
�
����4�a�f�=�=�=��������
��9�:�:�:��������?�r"c�&�eZdZd�Zd�Zd�Zd�ZdS)rc��tj��|_|jj|_|jj|_t|tj��dSr)�	threading�Lock�_lock�acquire�releaser
r�_at_fork_reinitr�s r!r�zForkAwareThreadLock.__init__qsC���^�%�%��
��z�)����z�)����D�"5�"E�F�F�F�F�Fr"c�8�|j���dSr)r�r�r�s r!r�z#ForkAwareThreadLock._at_fork_reinitws���
�"�"�$�$�$�$�$r"c�4�|j���Sr)r��	__enter__r�s r!r�zForkAwareThreadLock.__enter__zs���z�#�#�%�%�%r"c� �|jj|�Sr)r��__exit__)r�r s  r!r�zForkAwareThreadLock.__exit__}s��"�t�z�"�D�)�)r"N)r�r�r�r�r�r�r�r*r"r!rrpsS������G�G�G�%�%�%�&�&�&�*�*�*�*�*r"rc��eZdZd�Zd�ZdS)rc�(�t|d���dS)Nc�4�|j���Sr)�__dict__r�)rhs r!r�z)ForkAwareLocal.__init__.<locals>.<lambda>�s��s�|�/A�/A�/C�/C�r")r
r�s r!r�zForkAwareLocal.__init__�s���D�"C�"C�D�D�D�D�Dr"c�$�t|��dfS)Nr*)rsr�s r!�
__reduce__zForkAwareLocal.__reduce__�s���D�z�z�2�~�r"N)r�r�r�r�r�r*r"r!rr�s5������E�E�E�����r"r�SC_OPEN_MAX�c�(�t|��dtgz}|���|dtks
Jd���tt	|��dz
��D])}tj||dz||dz���*dS)N���zfd too larger)r`�MAXFDrc�range�lenr}�
closerange)�fds�is  r!rr�s���
�s�)�)�r�5�k�
!�C��H�H�J�J�J��r�7�e����^����
�3�s�8�8�a�<�
 �
 �*�*��
�
�c�!�f�Q�h��A�a�C��)�)�)�)�*�*r"c��tj�dS	tj���n#ttf$rYnwxYw	tjt
jt
j��}	t
|dd���t_dS#tj|���xYw#ttf$rYdSwxYw)Nzutf-8F)�encoding�closefd)	rG�stdin�close�OSErrorrwr}�open�devnull�O_RDONLY)�fds r!�_close_stdinr��s���
�y����
��	���������Z� �
�
�
���
����
�
�W�R�Z���
-�
-��	��R�'�5�A�A�A�C�I�I�I��	��H�R�L�L�L�������Z� �
�
�
����
���s3�/�A�A�)B)�1B�B&�&B)�)B>�=B>c���	tj���n#ttf$rYnwxYw	tj���dS#ttf$rYdSwxYwr)rG�stdout�flushr�rw�stderrr*r"r!�_flush_std_streamsr��s���
��
���������J�'�
�
�
���
����
��
����������J�'�
�
�
����
���s�!�5�5�A�A.�-A.c��ddl}ddl}ttt	t
|������}t
j��\}}	|�||gd|dddddddd||dddddddd|j	��t
j
|��t
j
|��S#t
j
|��t
j
|��wxYw)NrTr�F)�_posixsubprocess�
subprocess�tuple�sorted�maprqr}�pipe�	fork_exec�
_USE_VFORKr�)�pathr �passfdsr�r��errpipe_read�
errpipe_writes       r!�spawnv_passfdsr��s������������F�3�s�G�,�,�-�-�.�.�G�"$�'�)�)��L�-� ��)�)��4�&�$���t���B��B��L�-��5�"�d�D�$��D��!�	#�#�	������
��������	������
���������s�0B(�(*Cc�8�|D]}tj|���dS)z/Close each file descriptor given as an argumentN)r}r�)r�r�s  r!�	close_fdsr��s*������
��������r"c� �ddlm}tj��ddlm}|j���ddlm}|j	���t��|���|���dS)zKCleanup multiprocessing resources when multiprocessing tests
    completed.r)�support)�
forkserver)�resource_trackerN)
�testr�r�_cleanuprr��_forkserver�_stopr��_resource_trackerr��
gc_collect�
reap_children)r�r�r�s   r!�_cleanup_testsr��s��������������+�*�*�*�*�*��� � �"�"�"�1�0�0�0�0�0��&�,�,�.�.�.������������������r"r)<r}�	itertoolsrGrtr1r�r�r�r�__all__�NOTSETrr$r&rr.r:rr?rrrr	r
rrIrQ�abstract_sockets_supportedrWr�WeakValueDictionaryra�countrmrjr
r�r{�objectrr�rr�r�rTr2r3r�localr�sysconfr�rdrr�r�r�r�r�r*r"r!�<module>r
sD��
�	�	�	�����
�
�
�
�����
�
�
�
�����3�3�3�3�3�3�����������
����
��	��
�
���F��
����*�*�*�'�'�'�&�&�&�,�,�,����6����*���A�A�A�A�@�B�B��2�2�2����$2�g�1�3�3��$�Y�_�&�&��8�8�8�I�I�I���$�Y�_�&�&��S�S�S�S�S�v�S�S�S�l&$�&$�&$�&$�X(�(�(����E�?�#*�#:�#*�#:�(�(�(�(�T�������*�*�*�*�*�&�*�*�*�"�����Y�_������B�J�}�%�%�E�E�������E�E�E�����*�*�*�
�
�
�.
�
�
�
 �
 �
 � �������s�5D�D�D

ZeroDay Forums Mini