AlkantarClanX12

Your IP : 18.227.52.248


Current Path : /opt/alt/python39/lib64/python3.9/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/multiprocessing/__pycache__/process.cpython-39.pyc

a

R�f�.�@s2gd�ZddlZddlZddlZddlZddlZddlmZzej�	e�
��ZWneyfdZYn0dd�Z
dd�Zdd	�Zd
d�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]0\Z!Z"e!dd�dkr�de!vr�de!��ee"<q�e�Z#dS))�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcCstS)z@
    Return process object representing the current process
    )�_current_process�rr�</opt/alt/python39/lib64/python3.9/multiprocessing/process.pyr%srcCst�tt�S)zN
    Return list of process objects corresponding to live child processes
    )�_cleanup�list�	_childrenrrrr	r+srcCstS)z?
    Return process object representing the parent process
    )�_parent_processrrrr	r3srcCs*tt�D]}|j��durt�|�qdS�N)rr�_popen�poll�discard)�prrr	r
=sr
c@s�eZdZdZdd�Zddddifdd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
d,dd�Zdd�Zdd�Z
edd��Zejdd��Zedd��Zejdd��Zedd ��Zejd!d ��Zed"d#��Zed$d%��ZeZed&d'��Zd(d)�Zd-d*d+�ZdS).rz�
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    cCst�dSr)�NotImplementedError��selfrrr	�_PopenMszBaseProcess._PopenNr)�daemoncCs�|dusJd��tt�}tj|f|_tj��|_t��|_tj	|_
d|_d|_||_
t|�|_t|�|_|p�t|�jdd�dd�|jD��|_|dur�||_t�|�dS)Nz#group argument must be None for nowF�-�:css|]}t|�VqdSr)�str)�.0�irrr	�	<genexpr>^�z'BaseProcess.__init__.<locals>.<genexpr>)�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�targetr'�args�kwargsr�countrrr	�__init__Ps"


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r)�
ValueErrorrrrr	�
_check_closedcszBaseProcess._check_closedcCs|jr|j|ji|j��dS)zQ
        Method to be run in sub-process; can be overridden in sub-class
        N)r*r,r.rrrr	�rungszBaseProcess.runcCsz|��|jdusJd��|jt��ks0Jd��tj�d�rDJd��t�|�	|�|_|jj
|_|`|`
|`t�|�dS)z%
        Start child process
        Nzcannot start a process twicez:can only start a process object created by current processrz3daemonic processes are not allowed to have children)r<rr&r$r%rr"�getr
r�sentinel�	_sentinelr*r,r.rr4rrrr	�startns��
zBaseProcess.startcCs|��|j��dS)zT
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        N)r<r�	terminaterrrr	rB�szBaseProcess.terminatecCs|��|j��dS)zT
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        N)r<r�killrrrr	rC�szBaseProcess.killcCsR|��|jt��ksJd��|jdus0Jd��|j�|�}|durNt�|�dS)z5
        Wait until child process terminates
        zcan only join a child processNzcan only join a started process)r<r&r$r%r�waitrr)r�timeout�resrrr	r1�szBaseProcess.joincCs`|��|turdS|jt��ks*Jd��|jdur8dS|j��}|durNdSt�|�dSdS)z1
        Return whether process is alive
        Tzcan only test a child processNF)	r<rr&r$r%rrrr)r�
returncoderrr	�is_alive�s


zBaseProcess.is_alivecCsH|jdur>|j��dur 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)rrr;�closer@rrr)rrrr	rI�s


zBaseProcess.closecCs|jSr)r2rrrr	r'�szBaseProcess.namecCst|t�sJd��||_dS)Nzname must be a string)�
isinstancerr2)rr'rrr	r'�scCs|j�dd�S)z4
        Return whether process is a daemon
        rF)r"r>rrrr	r�szBaseProcess.daemoncCs |jdusJd��||jd<dS)z1
        Set whether process is a daemon
        Nzprocess has already startedr)rr")rZdaemonicrrr	r�scCs
|jdS)N�authkey)r"rrrr	rK�szBaseProcess.authkeycCst|�|jd<dS)z2
        Set authorization key of process
        rKN)�AuthenticationStringr")rrKrrr	rK�scCs"|��|jdur|jS|j��S)zM
        Return exit code of process or `None` if it has yet to stop
        N)r<rrrrrr	�exitcode�s
zBaseProcess.exitcodecCs*|��|turt��S|jo$|jjSdS)zU
        Return identifier (PID) of process or `None` if it has yet to start
        N)r<rr$r%r�pidrrrr	�ident�szBaseProcess.identcCs2|��z|jWSty,td�d�Yn0dS)z{
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        zprocess not startedN)r<r@�AttributeErrorr;rrrr	r?�s
zBaseProcess.sentinelcCs�d}|turd}nL|jrd}n@|jt��kr2d}n,|jdurBd}n|j��}|durZd}nd}t|�jd|j	g}|jdur�|�
d|jj�|�
d|j�|�
|�|dur�t�
||�}|�
d	|�|jr�|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )rr)r&r$r%rrr/r0r2�appendrN�_exitcode_to_namer>rr1)rrMZstatus�inforrr	�__repr__s0




zBaseProcess.__repr__c
Cs�ddlm}m}�z`z�|jdur,|�|j�t�d�at�a	|�
�t}|at|j
|j|�atjrnt����z|j��|��W~n~0|�d�z|��d}W|��n
|��0Wn�t�y }zJ|jdur�d}n.t|jt�r�|j}ntj� t!|j�d�d}WYd}~n:d}~0d}ddl"}tj� d|j#�|�$�Yn0Wt�%�|�d|�|�&�n t�%�|�d|�|�&�0|S)N�)�util�contextz child process calling self.run()r�
zProcess %s:
z process exiting with exitcode %d)'�rZr[Z
_start_methodZ_force_start_method�	itertoolsr9r �setrZ_close_stdinr�_ParentProcessr(r&r
�	threadingZ_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_idZ_finalizer_registry�clearZ_run_after_forkersrWr=Z_exit_function�
SystemExit�coderJ�int�sys�stderr�writer�	tracebackr'�	print_excZ	_shutdownZ_flush_std_streams)rZparent_sentinelrZr[Zold_processrM�erirrr	�
_bootstrap"sT


�




�
zBaseProcess._bootstrap)N)N)r0�
__module__�__qualname__�__doc__rr:r<r=rArBrCr1rHrI�propertyr'�setterrrKrMrOrNr?rXrlrrrr	rGsD�







	


rc@seZdZdd�ZdS)rLcCs,ddlm}|�durtd��tt|�ffS)NrY)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r[rr�	TypeErrorrL�bytes)rrrrrr	�
__reduce__Xs
�zAuthenticationString.__reduce__N)r0rmrnrurrrr	rLWsrLc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)r`cCs4d|_||_||_d|_d|_d|_||_i|_dS)NrF)r!r2�_pidr&rr)r@r")rr'rNr?rrr	r:hsz_ParentProcess.__init__cCsddlm}||jgdd�S)Nr�rD�rE�Zmultiprocessing.connectionrDr@)rrDrrr	rHrsz_ParentProcess.is_alivecCs|jSr)rvrrrr	rOvsz_ParentProcess.identNcCs ddlm}||jg|d�dS)z6
        Wait until parent process terminates
        rrwrxNry)rrErDrrr	r1zsz_ParentProcess.join)N)	r0rmrnr:rHrprOr1rNrrrr	r`fs


r`c@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)NrZMainProcessF� z/mp)rKZ	semprefix)	r!r2r&rr)rLr$�urandomr"rrrr	r:�s�z_MainProcess.__init__cCsdSrrrrrr	rI�sz_MainProcess.closeN)r0rmrnr:rIrrrr	rz�srzrY�ZSIG�_r)$�__all__r$rf�signalr^raZ_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr
�objectrrtrLr`rzr
rr9r r_rrVr�__dict__�itemsr'Zsignumr3rrrr	�<module>
s<


!