Your IP : 18.220.13.15


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

�

c��fk/��&�gd�ZddlZddlZddlZddlZddlZddlmZ	ej�	ej
����Zn
#e$rdZYnwxYwd�Z
d�Zd�Zd�ZGd�d	e��ZGd
�de��ZGd�d
e��ZGd�de��Zdae��aejd��ae��a[iZeej� ����D] \Z!Z"e!dd�dkr
de!vr	de!��ee"<�![!["e��Z#dS))�BaseProcess�current_process�active_children�parent_process�N)�WeakSetc��tS)z@
    Return process object representing the current process
    )�_current_process���>/opt/alt/python311/lib64/python3.11/multiprocessing/process.pyrr%s
���rc�F�t��tt��S)zN
    Return list of process objects corresponding to live child processes
    )�_cleanup�list�	_childrenr
rrrr+s��
�J�J�J��	�?�?�rc��tS)z?
    Return process object representing the parent process
    )�_parent_processr
rrrr3s
���rc��tt��D]9}|jx}r.|����t�|���:dS�N)rr�_popen�poll�discard)�p�child_popens  rrr=sV��
�)�_�_�!�!���8�#�K�	!��)9�)9�);�);�)G����a� � � ��!�!rc�n�eZdZdZd�Zddddifdd�d�Zd�Zd�Zd	�Zd
�Z	d�Z
dd�Zd
�Zd�Z
ed���Zejd���Zed���Zejd���Zed���Zejd���Zed���Zed���ZeZed���Zd�Zdd�Zed���ZdS)rz�
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    c��t�r)�NotImplementedError��selfs r�_PopenzBaseProcess._PopenMs��!�!rNr
)�daemonc�6�tt��}tj|fz|_tj���|_t
j��|_tj	|_
d|_d|_||_
t|��|_t!|��|_|p;t%|��jdzd�d�|jD����z|_|�||_t.�|��dS)NF�-�:c3�4K�|]}t|��V��dSr)�str)�.0�is  r�	<genexpr>z'BaseProcess.__init__.<locals>.<genexpr>^s(����=�=��c�!�f�f�=�=�=�=�=�=r)�next�_process_counterr	�	_identity�_config�copy�os�getpid�_parent_pid�name�_parent_namer�_closed�_target�tuple�_args�dict�_kwargs�type�__name__�join�_namer �	_dangling�add)r�group�targetr1�args�kwargsr �counts        r�__init__zBaseProcess.__init__Ps����%�&�&��)�3�u�h�>���'�/�4�4�6�6����9�;�;���,�1�������������4�[�[��
��F�|�|����>�T�$�Z�Z�0�3�6��X�X�=�=�d�n�=�=�=�=�=�>��
��� �D�K��
�
�d�����rc�2�|jrtd���dS)Nzprocess object is closed)r3�
ValueErrorrs r�
_check_closedzBaseProcess._check_closedcs%���<�	9��7�8�8�8�	9�	9rc�F�|jr|j|ji|j��dSdS)zQ
        Method to be run in sub-process; can be overridden in sub-class
        N)r4r6r8rs r�runzBaseProcess.rungs9���<�	6��D�L�$�*�5���5�5�5�5�5�	6�	6rc���|���t��|�|��|_|jj|_|`|`|`t�
|��dS)z%
        Start child process
        N)rGrrr�sentinel�	_sentinelr4r6r8rr>rs r�startzBaseProcess.startnsg��	
������	�
�
�
��k�k�$�'�'�����-���
�L�$�*�d�l��
�
�d�����rc�`�|���|j���dS)zT
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        N)rGr�	terminaters rrOzBaseProcess.terminate�s0��	
��������������rc�`�|���|j���dS)zT
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        N)rGr�killrs rrQzBaseProcess.kill�s0��	
��������������rc��|���|j�|��}|�t�|��dSdS)z5
        Wait until child process terminates
        N)rGr�waitrr)r�timeout�ress   rr;zBaseProcess.join�sS��	
�������k���w�'�'���?����d�#�#�#�#�#��?rc���|���|turdS|j�dS|j���}|�dSt�|��dS)z1
        Return whether process is alive
        TNF)rGr	rrrr)r�
returncodes  r�is_alivezBaseProcess.is_alive�sm��	
�������#�#�#��4��;���5��[�%�%�'�'�
����4����d�#�#�#��5rc���|j�d|j����td���|j���d|_|`t
�|��d|_dS)z�
        Close the Process object.

        This method releases resources held by the Process object.  It is
        an error to call this method if the child process is still running.
        Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrrF�closerLrrr3rs rrZzBaseProcess.close�sz���;�"��{���!�!�)� �"P�Q�Q�Q��K�������D�K������d�#�#�#�����rc��|jSr�r<rs rr1zBaseProcess.name�s
���z�rc��||_dSrr\)rr1s  rr1zBaseProcess.name�s����
�
�
rc�8�|j�dd��S)z4
        Return whether process is a daemon
        r F)r,�getrs rr zBaseProcess.daemon�s��
�|����%�0�0�0rc��||jd<dS)z1
        Set whether process is a daemon
        r N�r,)r�daemonics  rr zBaseProcess.daemon�s��"*���X���rc��|jdS)N�authkeyrars rrdzBaseProcess.authkey�s���|�I�&�&rc�4�t|��|jd<dS)z2
        Set authorization key of process
        rdN)�AuthenticationStringr,)rrds  rrdzBaseProcess.authkey�s��
#7�w�"?�"?���Y���rc�x�|���|j�|jS|j���S)zM
        Return exit code of process or `None` if it has yet to stop
        )rGrrrs r�exitcodezBaseProcess.exitcode�s:��
	
�������;���;���{���!�!�!rc��|���|turtj��S|jo|jjS)zU
        Return identifier (PID) of process or `None` if it has yet to start
        )rGr	r.r/r�pidrs r�identzBaseProcess.ident�s?��
	
�������#�#�#��9�;�;���;�2�4�;�?�2rc�v�|���	|jS#t$rtd��d�wxYw)z{
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        zprocess not startedN)rGrL�AttributeErrorrFrs rrKzBaseProcess.sentinel�sO��	
������	>��>�!���	>�	>�	>��2�3�3��=�	>���s��8c��d}|turd}nS|jrd}nI|jtj��krd}n*|j�d}n |j���}|�d}nd}t|��jd|j	zg}|j�"|�
d|jjz��|�
d|jz��|�
|��|�3t�
||��}|�
d	|z��|jr|�
d
��dd�|��zS)
N�started�closed�unknown�initial�stoppedzname=%rzpid=%sz	parent=%szexitcode=%sr z<%s>� )r	r3r0r.r/rrr9r:r<�appendrj�_exitcode_to_namer_r r;)rrh�status�infos    r�__repr__zBaseProcess.__repr__sF�����#�#�#��F�F�
�\�	#��F�F�
�
�����
,�
,��F�F�
�[�
 ��F�F��{�'�'�)�)�H��#�"���"���T�
�
�#�Y���%;�<���;�"��K�K��4�;�?�2�3�3�3����K�$�"2�2�3�3�3����F������(�,�,�X�x�@�@�H��K�K�
��0�1�1�1��;�	"��K�K��!�!�!��������&�&rc���ddlm}m}	|j�|�|j��tjd��at��a	|�
��t}|at|j
|j|��at jr%t!j�����	|���~n#~wxYw|�d��	|���d}|���n#|���wxYwn�#t0$rl}|j�d}nXt5|jt6��r|j}n6t8j�t?|j��dz��d}Yd}~nKd}~wd}ddl }t8j�d|j!z��|�"��YnxYwt!j#��|�d|z��|�$��nD#t!j#��|�d|z��|�$��wxYw|S)N�)�util�contextz child process calling self.run()r�
zProcess %s:
z process exiting with exitcode %d)%�r|r}�
_start_method�_force_start_method�	itertoolsrCr*�setr�_close_stdinr	�_ParentProcessr2r0r�	threading�_HAVE_THREAD_NATIVE_ID�main_thread�_set_native_id�_after_forkrxrI�_exit_function�
SystemExit�code�
isinstance�int�sys�stderr�writer%�	tracebackr1�	print_exc�	_shutdown�_flush_std_streams)r�parent_sentinelr|r}�old_processrh�er�s        r�
_bootstrapzBaseProcess._bootstrap"s|��#�#�#�#�#�#�#�#�(	&��!�-��+�+�D�,>�?�?�?�(��q�1�1�����I�������*�K�#��,��!�4�#3�_�F�F�O��/�
9��%�'�'�6�6�8�8�8�
 �� � �"�"�"� �K��K������I�I�8�9�9�9�
&����
�
�
����#�#�%�%�%�%���#�#�%�%�%�%����%���	�	�	��v�~�����A�F�C�(�(�
��6����
� � ��Q�V���t�!3�4�4�4������������	"��H������J���_�t�y�8�9�9�9����!�!�!�!�!������!�!�!��I�I�8�8�C�D�D�D��#�#�%�%�%�%��
��!�!�!��I�I�8�8�C�D�D�D��#�#�%�%�%�%�����sc�B,D.�7C
�D.�
C�D.�)D�?D.�D*�*D.�-H*�.
G'�8A"F�H*�AG'�%H*�*AI+c�l�ddlm}|j���|���dS)Nr{�r|)rr|�_finalizer_registry�clear�_run_after_forkersr�s rr�zBaseProcess._after_forkRsA��������� �&�&�(�(�(����!�!�!�!�!rr)r:�
__module__�__qualname__�__doc__rrDrGrIrMrOrQr;rXrZ�propertyr1�setterr rdrhrkrjrKryr��staticmethodr�r
rrrrGs��������
"�"�"�"�$�T��2��������&9�9�9�6�6�6����$ � � ����	$�	$�	$�	$����&���"����X��
�[����[���1�1��X�1��]�*�*��]�*��'�'��X�'�
�^�@�@��^�@��"�"��X�"��3�3��X�3��C�
�	>�	>��X�	>�'�'�'�>.�.�.�.�`�"�"��\�"�"�"rrc��eZdZd�ZdS)rfc�n�ddlm}|���td���tt	|��ffS)Nr{)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r}r��	TypeErrorrf�bytes)rr�s  r�
__reduce__zAuthenticationString.__reduce__^sO��/�/�/�/�/�/�����'��2���
�$�e�D�k�k�^�3�3rN)r:r�r�r�r
rrrfrf]s#������4�4�4�4�4rrfc�<�eZdZd�Zd�Zed���Zdd�ZeZdS)r�c�v�d|_||_||_d|_d|_d|_||_i|_dS)Nr
F)r+r<�_pidr0rr3rLr,)rr1rjrKs    rrDz_ParentProcess.__init__ns?�������
���	����������!�������rc�6�ddlm}||jgd���S)Nr�rS�rT��multiprocessing.connectionrSrL)rrSs  rrXz_ParentProcess.is_alivexs1��3�3�3�3�3�3��4���(�!�4�4�4�4�4rc��|jSr)r�rs rrkz_ParentProcess.ident|s
���y�rNc�8�ddlm}||jg|���dS)z6
        Wait until parent process terminates
        rr�r�Nr�)rrTrSs   rr;z_ParentProcess.join�s6��	4�3�3�3�3�3���d�n�
�w�/�/�/�/�/�/rr)	r:r�r�rDrXr�rkr;rjr
rrr�r�lsb���������5�5�5�����X��0�0�0�0��C�C�Crr�c��eZdZd�Zd�ZdS)�_MainProcessc��d|_d|_d|_d|_d|_tt
jd����dd�|_dS)Nr
�MainProcessF� z/mp)rd�	semprefix)	r+r<r0rr3rfr.�urandomr,rs rrDz_MainProcess.__init__�sN�����"��
����������#7��
�2���#G�#G�%*�,�,����rc��dSrr
rs rrZz_MainProcess.close�s���rN)r:r�r�rDrZr
rrr�r��s2������,�,�,�$
�
�
�
�
rr�r{��SIG�_r")$�__all__r.r��signalr�r��_weakrefsetr�path�abspath�getcwd�ORIGINAL_DIR�OSErrorrrrr�objectrr�rfr�r�rr	rCr*r�rrvr�__dict__�itemsr1�signumr=r
rr�<module>r�s:������
�	�	�	�
�
�
�
�
�
�
�
�����������������7�?�?�9�2�9�;�;�/�/�L�L�������L�L�L��������������!�!�!�O"�O"�O"�O"�O"�&�O"�O"�O"�l4�4�4�4�4�5�4�4�4������[����B
�
�
�
�
�;�
�
�
�0���<�>�>��"�9�?�1�%�%���C�E�E�	�����D���.�.�0�0�1�1�0�0�L�D�&��B�Q�B�x����3�d�?�?�%/��Z�Z��6�'�"���&�
�G�I�I�	�	�	s�'A�A�A

?>