Your IP : 3.145.37.211


Current Path : /usr/lib64/python3.8/multiprocessing/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/multiprocessing/__pycache__/process.cpython-38.opt-2.pyc

U

e5d�.�@s8ddddgZddlZddlZddlZddlZddlZddlmZzej�	e�
��ZWnek
rldZYnXdd�Z
dd�Zd	d�Zd
d�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]0\Z!Z"e!dd�dkr�de!kr�de!��ee"<q�e�Z#dS)�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcCstS�N)�_current_process�r	r	�//usr/lib64/python3.8/multiprocessing/process.pyr%scCst�tt�Sr)�_cleanup�list�	_childrenr	r	r	r
r+scCstSr)�_parent_processr	r	r	r
r3scCs*tt�D]}|j��dk	rt�|�qdSr)rr
�_popen�poll�discard)�pr	r	r
r=src@s�eZdZdd�Zddddifdd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	d+dd�Z
dd�Zdd�Ze
dd��Zejdd��Ze
dd��Zejdd��Ze
dd��Zejd d��Ze
d!d"��Ze
d#d$��ZeZe
d%d&��Zd'd(�Zd,d)d*�ZdS)-rcCst�dSr)�NotImplementedError��selfr	r	r
�_PopenMszBaseProcess._PopenNr	)�daemoncCs�tt�}tj|f|_tj��|_t��|_tj	|_
d|_d|_||_
t|�|_t|�|_|p�t|�jdd�dd�|jD��|_|dk	r�||_t�|�dS)NF�-�:css|]}t|�VqdSr)�str)�.0�ir	r	r
�	<genexpr>^sz'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�countr	r	r
�__init__Ps 


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r(�
ValueErrorrr	r	r
�
_check_closedcszBaseProcess._check_closedcCs|jr|j|j|j�dSr)r)r+r-rr	r	r
�rungszBaseProcess.runcCs>|��t�|�|�|_|jj|_|`|`|`t	�
|�dSr)r;rrr�sentinel�	_sentinelr)r+r-r
r3rr	r	r
�startns
zBaseProcess.startcCs|��|j��dSr)r;r�	terminaterr	r	r
r@�szBaseProcess.terminatecCs|��|j��dSr)r;r�killrr	r	r
rA�szBaseProcess.killcCs*|��|j�|�}|dk	r&t�|�dSr)r;r�waitr
r)r�timeout�resr	r	r
r0�szBaseProcess.joincCsJ|��|tkrdS|jdkr"dS|j��}|dkr8dSt�|�dSdS)NTF)r;rrrr
r)r�
returncoder	r	r
�is_alive�s


zBaseProcess.is_alivecCsH|jdk	r>|j��dkr td��|j��d|_|`t�|�d|_dS)Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrr:�closer>r
rr(rr	r	r
rG�s


zBaseProcess.closecCs|jSr�r1rr	r	r
r&�szBaseProcess.namecCs
||_dSrrH)rr&r	r	r
r&�scCs|j�dd�S)NrF)r!�getrr	r	r
r�szBaseProcess.daemoncCs||jd<dS)Nr�r!)rZdaemonicr	r	r
r�scCs
|jdS�N�authkeyrJrr	r	r
rL�szBaseProcess.authkeycCst|�|jd<dSrK)�AuthenticationStringr!)rrLr	r	r
rL�scCs"|��|jdkr|jS|j��Sr)r;rrrr	r	r
�exitcode�s
zBaseProcess.exitcodecCs*|��|tkrt��S|jo$|jjSdSr)r;rr#r$r�pidrr	r	r
�ident�szBaseProcess.identcCs4|��z|jWStk
r.td�d�YnXdS)Nzprocess not started)r;r>�AttributeErrorr:rr	r	r
r=�s
zBaseProcess.sentinelcCs�d}|tkrd}nL|jrd}n@|jt��kr2d}n,|jdkrBd}n|j��}|dk	rZd}nd}t|�jd|j	g}|jdk	r�|�
d|jj�|�
d|j�|�
|�|dk	r�t�
||�}|�
d	|�|jr�|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )rr(r%r#r$rrr.r/r1�appendrO�_exitcode_to_namerIrr0)rrNZstatus�infor	r	r
�__repr__s0




zBaseProcess.__repr__c
Csvddlm}m}�z>z�|jdk	r,|�|j�t	�
d�at�a
|��t}|at|j|j|�atjrnt����z|j��|��W5~X|�d�z|��d}W5|��XWn�tk
�r}zJ|js�d}n:t|jdt�r�|jd}nt j!�"t#|jd�d�d}W5d}~XYn2d}ddl$}t j!�"d|j%�|�&�YnXW5t��|�d|�|��X|S)N�)�util�contextz process exiting with exitcode %dz child process calling self.run()r�
zProcess %s:
)'�r[r\�	threadingZ	_shutdownrXZ_flush_std_streamsZ
_start_methodZ_force_start_method�	itertoolsr8r�setr
Z_close_stdinr�_ParentProcessr'r%rZ_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_idZ_finalizer_registry�clearZ_run_after_forkersZ_exit_functionr<�
SystemExitr6�
isinstance�int�sys�stderr�writer�	tracebackr&�	print_exc)rZparent_sentinelr[r\rNZold_process�erjr	r	r
�
_bootstrap"sR

�


zBaseProcess._bootstrap)N)N)r/�
__module__�__qualname__rr9r;r<r?r@rAr0rFrG�propertyr&�setterrrLrNrPrOr=rYrmr	r	r	r
rGsB�







	


c@seZdZdd�ZdS)rMcCs,ddlm}|�dkrtd��tt|�ffS)NrZ)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r\rr�	TypeErrorrM�bytes)rrrr	r	r
�
__reduce__Xs
�zAuthenticationString.__reduce__N)r/rnrorur	r	r	r
rMWsrMc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)rbcCs4d|_||_||_d|_d|_d|_||_i|_dS)Nr	F)r r1�_pidr%rr(r>r!)rr&rOr=r	r	r
r9hsz_ParentProcess.__init__cCsddlm}||jgdd�S�Nr)rB)rC�Zmultiprocessing.connectionrBr>)rrBr	r	r
rFrsz_ParentProcess.is_alivecCs|jSr)rvrr	r	r
rPvsz_ParentProcess.identNcCs ddlm}||jg|d�dSrwrx)rrCrBr	r	r
r0zsz_ParentProcess.join)N)	r/rnror9rFrprPr0rOr	r	r	r
rbfs


rbc@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)Nr	ZMainProcessF� z/mp)rLZ	semprefix)	r r1r%rr(rMr#�urandomr!rr	r	r
r9�s�z_MainProcess.__init__cCsdSrr	rr	r	r
rG�sz_MainProcess.closeN)r/rnror9rGr	r	r	r
ry�sryrZ�ZSIG�_r)$�__all__r#rg�signalr`r_Z_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr�objectrrtrMrbryrrr8rrar
rWr�__dict__�itemsr&Zsignumr2r	r	r	r
�<module>
s@�


!


?>