AlkantarClanX12

Your IP : 3.147.78.242


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

U

e5d�!�@s�ddlZddlZddlZddlZddlZddlmZddlmZdddgZe	ed�Z
ejejfZ
d	d
d�iZejdkr�ddlZddlZe�ejejd
��Gdd�de�Ze�ZejZejZejZejZdd�ZdS)�N�)�spawn)�util�ensure_running�register�
unregister�pthread_sigmaskZnoopcCsdS�N�r
r
r
�8/usr/lib64/python3.8/multiprocessing/resource_tracker.py�<lambda>!�r�posix)Z	semaphoreZ
shared_memoryc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ResourceTrackercCst��|_d|_d|_dSr	)�	threadingZLock�_lock�_fd�_pid��selfr
r
r�__init__0s
zResourceTracker.__init__c	CsT|j�D|jdkr W5QR�dSt�|j�d|_t�|jd�d|_W5QRXdS)Nr)rr�os�close�waitpidrrr
r
r�_stop5s
zResourceTracker._stopcCs|��|jSr	)rrrr
r
r�getfdBszResourceTracker.getfdcCst|j��b|jdk	r~|��r*W5QR�dSt�|j�z|jdk	rPt�|jd�Wntk
rfYnXd|_d|_t�	d�g}z|�
tj�
��Wntk
r�YnXd}t��\}}z�zr|�
|�t��}|gt��}|d||g7}z&t�rt�tjt�t�|||�}W5t�r,t�tjt�XWnt�|��YnX||_||_W5t�|�XW5QRXdS)NrzUresource_tracker: process died unexpectedly, relaunching.  Some resources might leak.z:from multiprocessing.resource_tracker import main;main(%d)z-c)rr�_check_aliverrrr�ChildProcessError�warnings�warn�append�sys�stderr�fileno�	Exception�piperZget_executablerZ_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr�SIG_UNBLOCK�_IGNORED_SIGNALS�	SIG_BLOCKZspawnv_passfds)rZfds_to_pass�cmd�r�wZexe�args�pidr
r
rrFsJ






zResourceTracker.ensure_runningcCs2zt�|jd�Wntk
r(YdSXdSdS)Ns
PROBE:0:noop
FT)r�writer�OSErrorrr
r
rr�s
zResourceTracker._check_alivecCs|�d||�dS)N�REGISTER��_send�r�name�rtyper
r
rr�szResourceTracker.registercCs|�d||�dS)N�
UNREGISTERr3r5r
r
rr�szResourceTracker.unregistercCsB|��d�|||��d�}t|�dkr0td��t�|j|�}dS)Nz{0}:{1}:{2}
�asciiiz
name too long)r�format�encode�len�
ValueErrorrr0r)rr+r6r7�msg�nbytesr
r
rr4�szResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrrrrr4r
r
r
rr.s
@rc
Cst�tjtj�t�tjtj�tr2t�tjt�tj	tj
fD]&}z|��Wq>tk
rbYq>Xq>dd�t
��D�}z�t|d���}|D]�}z�|���d��d�\}}}t
�|d�}	|	dkr�td|�d	|����|d
kr�||�|�n2|dk�r||�|�n|dk�rntd
|��Wq�tk
�rTztjt���WnYnXYq�Xq�W5QRXW5|��D]�\}}|�r�zt�dt|�|f�Wntk
�r�YnX|D]V}zLzt
||�Wn6tk
�r�}zt�d||f�W5d}~XYnXW5X�q��qnXdS)NcSsi|]}|t��qSr
)�set)�.0r7r
r
r�
<dictcomp>�szmain.<locals>.<dictcomp>zQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %s�rbr9�:zCannot register z. for automatic cleanup: unknown resource type r2r8ZPROBEzunrecognized command %r)r'�SIGINT�SIG_IGN�SIGTERMr&rr(r)r!�stdin�stdoutrr$�_CLEANUP_FUNCS�keys�itemsrrr<�open�strip�decode�split�getr=�add�remove�RuntimeError�
excepthook�exc_info)
�fd�f�cacher7Zrtype_cacher6�e�liner+Zcleanup_funcr
r
r�main�s^�


�
(r_)rr'r!rr�rr�__all__�hasattrr&rHrJr)rMr6Z_multiprocessingZ_posixshmem�updateZ
sem_unlinkZ
shm_unlink�objectrZ_resource_trackerrrrrr_r
r
r
r�<module>s4

�
�w