AlkantarClanX12

Your IP : 18.223.195.127


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

o

6��f
#�@s�ddlZddlZddlZddlZddlZddlmZddlmZgd�Ze	ed�Z
ejejfZ
ddd	�iZejd
krWddlZddlZe	ed�rOe�deji�e�d
eji�Gdd�de�Ze�ZejZejZejZejZdd�ZdS)�N�)�spawn)�util)�ensure_running�register�
unregister�pthread_sigmaskZnoopcCsdS�N�r
r
r
�G/opt/alt/python310/lib64/python3.10/multiprocessing/resource_tracker.py�<lambda>!sr�posix�
sem_unlinkZ	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__8s

zResourceTracker.__init__cCsn|j�*|jdur	Wd�dSt�|j�d|_t�|jd�d|_Wd�dS1s0wYdS)Nr)rr�os�close�waitpidrrr
r
r�_stop=s
�"�zResourceTracker._stopcCs|��|jSr	)rrrr
r
r�getfdJszResourceTracker.getfdcCs�|j��|jdur?|��r	Wd�dSt�|j�z|jdur)t�|jd�Wn	ty3Ynwd|_d|_t�	d�g}z
|�
tj�
��Wn	tyTYnwd}t��\}}zXzA|�
|�t��}|gt��}|d||g7}ztr�t�tjt�t�|||�}Wtr�t�tjt�ntr�t�tjt�wwWn	t�|��||_||_Wt�|�nt�|�wWd�dS1s�wYdS)z�Make sure that resource tracker process is running.

        This can be run from any process.  Usually a child process will use
        the resource created by its parent.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_BLOCK�_IGNORED_SIGNALSZspawnv_passfds�SIG_UNBLOCK)rZfds_to_pass�cmd�r�wZexe�args�pidr
r
rrNs^
�
��
�
����
"�zResourceTracker.ensure_runningcCs*z
t�|jd�WdStyYdSw)z;Check that the pipe has not been closed by sending a probe.s
PROBE:0:noop
FT)r�writer�OSErrorrr
r
rr�s��zResourceTracker._check_alivecC�|�d||�dS)z0Register name of resource with resource tracker.�REGISTERN��_send�r�name�rtyper
r
rr��zResourceTracker.registercCr2)z2Unregister name of resource with resource tracker.�
UNREGISTERNr4r6r
r
rr�r9zResourceTracker.unregistercCsb|��d�|||��d�}t|�dkrtd��t�|j|�}|t|�ks/Jd�|t|����dS)Nz{0}:{1}:{2}
�asciiizmsg too longznbytes {0:n} but len(msg) {1:n})r�format�encode�len�
ValueErrorrr0r)rr+r7r8�msg�nbytesr
r
rr5�s
�zResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrrrrr5r
r
r
rr6s
@rc
Cs�t�tjtj�t�tjtj�trt�tjt�tj	tj
fD]}z|��Wqty0Yqwdd�t
��D�}z�t|d��j}|D]_}zF|���d��d�\}}}t
�|d�}|durgtd|�d|����|d	krs||�|�n|d
kr||�|�n|dkr�ntd|��WqCty�z	tjt���WnYYqCwWd�n1s�wYW|��D]I\}}|r�z
t�d
t|�|f�Wn	ty�Ynw|D])}z&zt
||�Wnty�}	zt�d||	f�WYd}	~	nd}	~	wwWq�wq�dS|��D]N\}}|�r&z
t�d
t|�|f�Wn
t�y%Ynw|D]+}z(zt
||�Wnt�yO}	zt�d||	f�WYd}	~	nd}	~	wwW�q(w�qw)zRun resource tracker.cSsi|]}|t��qSr
)�set)�.0r8r
r
r�
<dictcomp>�szmain.<locals>.<dictcomp>�rbr;�:NzCannot register z. for automatic cleanup: unknown resource type r3r:ZPROBEzunrecognized command %rzQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %s)r'�SIGINT�SIG_IGN�SIGTERMr&rr*r)r!�stdin�stdoutrr$�_CLEANUP_FUNCS�keys�open�strip�decode�split�getr?�add�remove�RuntimeError�
excepthook�exc_info�itemsrrr>)
�fd�f�cache�liner+r7r8Zcleanup_funcZrtype_cache�er
r
r�main�s����������

�������

�������ra)rr'r!rr�rr�__all__�hasattrr&rJrLr)rOr7Z_multiprocessingZ_posixshmem�updaterZ
shm_unlink�objectrZ_resource_trackerrrrrrar
r
r
r�<module>s:
�

��w