CasperSecurity

Current Path : /lib/python3.10/multiprocessing/__pycache__/
Upload File :
Current File : //lib/python3.10/multiprocessing/__pycache__/resource_tracker.cpython-310.pyc

o

`�wi
#�@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_sigmask�noopcCsdS�N�rrr�7/usr/lib/python3.10/multiprocessing/resource_tracker.py�<lambda>!sr
�posix�
sem_unlink�	semaphore�
shared_memoryc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ResourceTrackercCst��|_d|_d|_dSr
)�	threading�Lock�_lock�_fd�_pid��selfrrr�__init__8s

zResourceTracker.__init__cCsn|j�*|jdur	Wd�dSt�|j�d|_t�|jd�d|_Wd�dS1s0wYdS)Nr)rr�os�close�waitpidrrrrr�_stop=s
�"�zResourceTracker._stopcCs|��|jSr
)rrrrrr�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�piper�get_executabler�_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr�	SIG_BLOCK�_IGNORED_SIGNALS�spawnv_passfds�SIG_UNBLOCK)r�fds_to_pass�cmd�r�w�exe�args�pidrrrrNs^
�
��
�
����
"�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�OSErrorrrrrr �s��zResourceTracker._check_alivecC�|�d||�dS)z0Register name of resource with resource tracker.�REGISTERN��_send�r�name�rtyperrrr��zResourceTracker.registercCr;)z2Unregister name of resource with resource tracker.�
UNREGISTERNr=r?rrrr�rBzResourceTracker.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�
ValueErrorrr9r)rr3r@rA�msg�nbytesrrrr>�s
�zResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrr rrr>rrrrr6s
@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)�.0rArrr�
<dictcomp>�szmain.<locals>.<dictcomp>�rbrD�:NzCannot register z. for automatic cleanup: unknown resource type r<rC�PROBEzunrecognized command %rzQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %s)r-�SIGINT�SIG_IGN�SIGTERMr,rr1r/r%�stdin�stdoutrr(�_CLEANUP_FUNCS�keys�open�strip�decode�split�getrH�add�remove�RuntimeError�
excepthook�exc_info�itemsr"r#rG)
�fd�f�cache�liner3r@rA�cleanup_func�rtype_cache�errr�main�s����������

�������

�������rm)rr-r%rr"�rr�__all__�hasattrr,rTrVr/rYr@�_multiprocessing�_posixshmem�updater�
shm_unlink�objectr�_resource_trackerrrrrrmrrrr�<module>s:
�

��w
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY