Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/process.cpython-37.opt-1.pyc

B

� f4)�@sdddgZddlZddlZddlZddlZddlZddlmZyej�	e�
��ZWnek
rjdZYnXdd�Z
dd�Zdd	�ZGd
d�de�ZGdd�de�ZGd
d�de�Ze�ae�d�ae�a[iZx<eej���D]*\ZZedd�dkr�dekr�eee<q�We�Z dS)�BaseProcess�current_process�active_children�N)�WeakSetcCstS)z@
    Return process object representing the current process
    )�_current_process�rr�</opt/alt/python37/lib64/python3.7/multiprocessing/process.pyr$scCst�tt�S)zN
    Return list of process objects corresponding to live child processes
    )�_cleanup�list�	_childrenrrrrr*scCs.x(tt�D]}|j��dk	r
t�|�q
WdS)N)r
r�_popen�poll�discard)�prrrr	5sr	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+�ZdS)-rz�
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    cCst�dS)N)�NotImplementedError)�selfrrr�_PopenEszBaseProcess._PopenNr)�daemoncCs�tt�}tj|f|_tj��|_t��|_d|_	d|_
||_t|�|_
t|�|_|pxt|�jdd�dd�|jD��|_|dk	r�||_t�|�dS)NF�-�:css|]}t|�VqdS)N)�str)�.0�irrr�	<genexpr>Usz'BaseProcess.__init__.<locals>.<genexpr>)�next�_process_counterr�	_identity�_config�copy�os�getpid�_parent_pidr�_closed�_target�tuple�_args�dict�_kwargs�type�__name__�join�_namer�	_dangling�add)r�group�target�name�args�kwargsr�countrrr�__init__Hs


zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r"�
ValueError)rrrr�
_check_closedZszBaseProcess._check_closedcCs|jr|j|j|j�dS)zQ
        Method to be run in sub-process; can be overridden in sub-class
        N)r#r%r')rrrr�run^szBaseProcess.runcCs>|��t�|�|�|_|jj|_|`|`|`t	�
|�dS)z%
        Start child process
        N)r6r	rr�sentinel�	_sentinelr#r%r'rr-)rrrr�startes
zBaseProcess.startcCs|��|j��dS)zT
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        N)r6r�	terminate)rrrrr;wszBaseProcess.terminatecCs|��|j��dS)zT
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        N)r6r�kill)rrrrr<~szBaseProcess.killcCs*|��|j�|�}|dk	r&t�|�dS)z5
        Wait until child process terminates
        N)r6r�waitrr)rZtimeoutZresrrrr*�szBaseProcess.joincCsJ|��|tkrdS|jdkr"dS|j��}|dkr8dSt�|�dSdS)z1
        Return whether process is alive
        TNF)r6rrr
rr)r�
returncoderrr�is_alive�s


zBaseProcess.is_alivecCsH|jdk	r>|j��dkr 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)rr
r5�closer9rrr")rrrrr@�s


zBaseProcess.closecCs|jS)N)r+)rrrrr0�szBaseProcess.namecCs
||_dS)N)r+)rr0rrrr0�scCs|j�dd�S)z4
        Return whether process is a daemon
        rF)r�get)rrrrr�szBaseProcess.daemoncCs||jd<dS)z1
        Set whether process is a daemon
        rN)r)rZdaemonicrrrr�scCs
|jdS)N�authkey)r)rrrrrB�szBaseProcess.authkeycCst|�|jd<dS)z2
        Set authorization key of process
        rBN)�AuthenticationStringr)rrBrrrrB�scCs"|��|jdkr|jS|j��S)zM
        Return exit code of process or `None` if it has yet to stop
        N)r6rr
)rrrr�exitcode�s
zBaseProcess.exitcodecCs*|��|tkrt��S|jo$|jjSdS)zU
        Return identifier (PID) of process or `None` if it has yet to start
        N)r6rrr r�pid)rrrr�ident�szBaseProcess.identcCs2|��y|jStk
r,td�d�YnXdS)z{
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        zprocess not startedN)r6r9�AttributeErrorr5)rrrrr8�s
zBaseProcess.sentinelcCs�|tkrd}nJ|jrd}n>|jt��kr.d}n*|jdkr>d}n|j��dk	rT|j}nd}t|�t	kr�|dkrrd}ndt
�||�}dt|�j|j
||jr�d	p�d
fS)NZstarted�closed�unknown�initialrZstoppedzstopped[%s]z<%s(%s, %s%s)>z daemon�)rr"r!rr rr
rDr(�int�_exitcode_to_namerAr)r+r)rZstatusrrr�__repr__�s"
zBaseProcess.__repr__c
CsRddlm}m}�zy||jdk	r,|�|j�t�d�at�a	|�
�t}|az|j�
�|��Wd~X|�d�z|��d}Wd|��XWn�tk
r�}zJ|js�d}n:t|jdt�r�|jd}ntj�t|jd�d�d}Wdd}~XYn2d}ddl}tj�d|j�|��YnXWdt��|�d|�|��X|S)N�)�util�contextz child process calling self.run()r�
zProcess %s:
z process exiting with exitcode %d) rKrPrQZ
_start_methodZ_force_start_method�	itertoolsr3r�setrZ_close_stdinrZ_finalizer_registry�clearZ_run_after_forkers�infor7Z_exit_function�
SystemExitr1�
isinstancerL�sys�stderr�writer�	tracebackr0�	print_exc�	threadingZ	_shutdownZ_flush_std_streams)rrPrQZold_processrD�er\rrr�
_bootstrapsD




zBaseProcess._bootstrap)N)r)�
__module__�__qualname__�__doc__rr4r6r7r:r;r<r*r?r@�propertyr0�setterrrBrDrFrEr8rNr`rrrrr?s0

c@seZdZdd�ZdS)rCcCs,ddlm}|�dkrtd��tt|�ffS)NrO)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)rQrf�	TypeErrorrC�bytes)rrfrrr�
__reduce__Fs

zAuthenticationString.__reduce__N)r)rarbrirrrrrCEsrCc@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)NrZMainProcessF� z/mp)rBZ	semprefix)	rr+r!rr"rCr�urandomr)rrrrr4Usz_MainProcess.__init__cCsdS)Nr)rrrrr@gsz_MainProcess.closeN)r)rarbr4r@rrrrrjSsrjrO�ZSIG�_)!�__all__rrY�signalrSr^Z_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrr	�objectrrhrCrjrr3rrTrrMr
�__dict__�itemsr0Zsignumr,rrrr�<module>
s6





Hacked By AnonymousFox1.0, Coded By AnonymousFox