Your IP : 3.142.172.250


Current Path : /opt/alt/python310/lib64/python3.10/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/multiprocessing/__pycache__/process.cpython-310.opt-2.pyc

o

6��f9/�@s2gd�ZddlZddlZddlZddlZddlZddlmZz
ej�	e�
��ZWney3dZYnwdd�Z
dd�Zdd	�Zd
d�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]\Z!Z"e!dd�dkr�de!vr�de!��ee"<q{e�Z#dS))�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcC�	tS�N)�_current_process�r
r
�>/opt/alt/python310/lib64/python3.10/multiprocessing/process.pyr%�rcCs	t�tt�Sr)�_cleanup�list�	_childrenr
r
r
rr+srcCrr)�_parent_processr
r
r
rr3rrcCs*tt�D]}|j��durt�|�qdSr)rr�_popen�poll�discard)�pr
r
rr
=s

��r
c@seZdZ	dd�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*�Zed+d,��ZdS).rcCst�r)�NotImplementedError��selfr
r
r�_PopenM�zBaseProcess._PopenNr
)�daemoncCs�tt�}tj|f|_tj��|_t��|_tj	|_
d|_d|_||_
t|�|_t|�|_|p@t|�jdd�dd�|jD��|_|durI||_t�|�dS)NF�-�:css�|]}t|�VqdSr)�str)�.0�ir
r
r�	<genexpr>^s�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�countr
r
r�__init__Ps 


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r+�
ValueErrorrr
r
r�
_check_closedcs�zBaseProcess._check_closedcCs$	|jr|j|ji|j��dSdSr)r,r.r0rr
r
r�rungs�zBaseProcess.runcCs@	|��t�|�|�|_|jj|_|`|`|`t	�
|�dSr)r>r
rr�sentinel�	_sentinelr,r.r0rr6rr
r
r�startns
zBaseProcess.startcC�	|��|j��dSr)r>r�	terminaterr
r
rrD��zBaseProcess.terminatecCrCr)r>r�killrr
r
rrF�rEzBaseProcess.killcCs0	|��|j�|�}|durt�|�dSdSr)r>r�waitrr)r�timeout�resr
r
rr3�s�zBaseProcess.joincCsH	|��|turdS|jdurdS|j��}|durdSt�|�dS)NTF)r>r	rrrr)r�
returncoder
r
r�is_alive�s


zBaseProcess.is_alivecCsJ	|jdur |j��durtd��|j��d|_|`t�|�d|_dS)Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrr=�closerArrr+rr
r
rrL�s



zBaseProcess.closecC�|jSr�r4rr
r
rr)��zBaseProcess.namecCs
||_dSrrN)rr)r
r
rr)�s
cCs	|j�dd�S)NrF)r$�getrr
r
rr�szBaseProcess.daemoncCs	||jd<dS)Nr�r$)rZdaemonicr
r
rr�scCs
|jdS�N�authkeyrQrr
r
rrS�s
zBaseProcess.authkeycCs	t|�|jd<dSrR)�AuthenticationStringr$)rrSr
r
rrS�scCs$	|��|jdur
|jS|j��Sr)r>rrrr
r
r�exitcode�s


zBaseProcess.exitcodecCs(	|��|tur
t��S|jo|jjSr)r>r	r&r'r�pidrr
r
r�ident�s
zBaseProcess.identcCs,	|��z|jWStytd�d�w)Nzprocess not started)r>rA�AttributeErrorr=rr
r
rr@�s
�zBaseProcess.sentinelcCs�d}|tur	d}n&|jrd}n |jt��krd}n|jdur!d}n|j��}|dur-d}nd}t|�jd|j	g}|jdurG|�
d|jj�|�
d|j�|�
|�|duret�
||�}|�
d	|�|jrm|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )r	r+r(r&r'rrr1r2r4�appendrV�_exitcode_to_namerPrr3)rrUZstatus�infor
r
r�__repr__s0




zBaseProcess.__repr__c
Cs�ddlm}m}z�zO|jdur|�|j�t�d�at�a	|�
�t}|at|j
|j|�atjr6t����z|��W~n~w|�d�z|��d}W|��n|��wWnYty�}z%|jdurhd}nt|jt�rr|j}n
tj�t|j�d�d}WYd}~n?d}~wd}ddl }tj�d|j!�|�"�YWt�#�|�d|�|�$�|SWt�#�|�d|�|�$�|SWt�#�|�d|�|�$�|St�#�|�d|�|�$�w)N�)�util�contextz child process calling self.run()r�
zProcess %s:
z process exiting with exitcode %d)%�rbrcZ
_start_methodZ_force_start_method�	itertoolsr;r"�setrZ_close_stdinr	�_ParentProcessr*r(r�	threadingZ_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_id�_after_forkr_r?Z_exit_function�
SystemExit�code�
isinstance�int�sys�stderr�writer�	tracebackr)�	print_excZ	_shutdownZ_flush_std_streams)rZparent_sentinelrbrcZold_processrU�errr
r
r�
_bootstrap"sh


�


�����
zBaseProcess._bootstrapcCs"ddlm}|j��|��dS)Nra�rb)rerbZ_finalizer_registry�clearZ_run_after_forkersrvr
r
rrjRs
zBaseProcess._after_forkr)r2�
__module__�__qualname__rr<r>r?rBrDrFr3rKrL�propertyr)�setterrrSrUrWrVr@r`ru�staticmethodrjr
r
r
rrGsJ�







	



0rc@seZdZdd�ZdS)rTcCs,ddlm}|�durtd��tt|�ffS)Nra)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)rcr}�	TypeErrorrT�bytes)rr}r
r
r�
__reduce__^s
�zAuthenticationString.__reduce__N)r2rxryr�r
r
r
rrT]srTc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)rhcCs4d|_||_||_d|_d|_d|_||_i|_dS)Nr
F)r#r4�_pidr(rr+rAr$)rr)rVr@r
r
rr<ns
z_ParentProcess.__init__cCsddlm}||jgdd�S�Nr)rG)rH�Zmultiprocessing.connectionrGrA)rrGr
r
rrKxsz_ParentProcess.is_alivecCrMr)r�rr
r
rrW|rOz_ParentProcess.identNcCs"	ddlm}||jg|d�dSr�r�)rrHrGr
r
rr3�sz_ParentProcess.joinr)	r2rxryr<rKrzrWr3rVr
r
r
rrhls


rhc@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)Nr
ZMainProcessF� z/mp)rSZ	semprefix)	r#r4r(rr+rTr&�urandomr$rr
r
rr<�s�z_MainProcess.__init__cCsdSrr
rr
r
rrL�rz_MainProcess.closeN)r2rxryr<rLr
r
r
rr��sr�ra�ZSIG�_r)$�__all__r&ro�signalrfriZ_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr
�objectrrrTrhr�rr	r;r"rgrr^r�__dict__�itemsr)Zsignumr5r
r
r
r�<module>sB	�

!
�


?>