CasperSecurity

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

o

`�wiM-�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdkr�Gdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"kr�eed#�Zn#eed$�ZnGd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@�eZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�./usr/lib/python3.10/multiprocessing/context.pyr�rc@r)�BufferTooShortNrrrrrrr
rc@r)�TimeoutErrorNrrrrrrr
rc@r)�AuthenticationErrorNrrrrrrr
rc@s\eZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdEdd�Zdd�ZdFdd�ZdGdd�ZdGdd�Zdd�Z		dHd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdDd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dDd7d8�Z$dId:d;�Z%dId<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)J�BaseContextcCst��}|durtd��|S)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�self�numrrrr)szBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)�managersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcC�ddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr )r�duplexr rrrr <�zBaseContext.PipecC�ddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr)�synchronizer%r)rr%rrrr%A�zBaseContext.LockcCr$)zReturns a recursive lock objectr)�RLockr)r&r(r)rr(rrrr(Fr'zBaseContext.RLockNcC�ddlm}|||��d�S)zReturns a condition objectr)�	Conditionr)r&r*r)r�lockr*rrrr*K�zBaseContext.ConditionrcCr))zReturns a semaphore objectr)�	Semaphorer)r&r-r)r�valuer-rrrr-Pr,zBaseContext.SemaphorecCr))z"Returns a bounded semaphore objectr)�BoundedSemaphorer)r&r/r)rr.r/rrrr/Ur,zBaseContext.BoundedSemaphorecCr$)zReturns an event objectr)�Eventr)r&r0r)rr0rrrr0Zr'zBaseContext.EventcC� ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)r&r2r)r�parties�action�timeoutr2rrrr2_szBaseContext.BarrierrcCr))�Returns a queue objectr)�Queuer)�queuesr7r)r�maxsizer7rrrr7dr,zBaseContext.QueuecCr))r6r)�
JoinableQueuer)r8r:r)rr9r:rrrr:ir,zBaseContext.JoinableQueuecCr$)r6r)�SimpleQueuer)r8r;r)rr;rrrr;nr'zBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)�poolr<r)r�	processes�initializer�initargs�maxtasksperchildr<rrrr<ss
�zBaseContext.PoolcGsddlm}||g|�R�S)zReturns a shared objectr)�RawValue)�sharedctypesrC)r�typecode_or_type�argsrCrrrrCzr,zBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)rDrG)rrE�size_or_initializerrGrrrrGs
zBaseContext.RawArray)r+cGs(ddlm}||g|�R||��d��S)z$Returns a synchronized shared objectr)�Value�r+r)rDrIr)rrEr+rFrIrrrrI�s�zBaseContext.ValuecCr1)z#Returns a synchronized shared arrayr)�ArrayrJ)rDrKr)rrErHr+rKrrrrK�s�zBaseContext.ArraycCs4tjdkrttdd�rddlm}|�dSdSdS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32�frozenFr)�freeze_supportN)�sys�platform�getattr�spawnrN)rrNrrrrN�s
�zBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrS)rrSrrrrS�szBaseContext.get_loggercCr)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rTrU)r�levelrUrrrrU�r#zBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)r!N)�r!)rr!rrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcC�ddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)rRrZ)r�
executablerZrrrrZ�szBaseContext.set_executablecCrY)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverr\)r�module_namesr\rrrr\�sz"BaseContext.set_forkserver_preloadcCsB|dur|Szt|}Wntytd|�d�w|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�s�zBaseContext.get_contextFcCs|jS�N)�_name�r�
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��)Nz+cannot set start method of concrete context)ra�rrc�forcerrr�set_start_method�szBaseContext.set_start_methodcCst��d�S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rl)rrrrrro��cC�dSrdrrnrrrrb�szBaseContext._check_available)Trd)r)NN)r)NNrN�F)+r	r
rrrrr�staticmethodr�current_process�parent_process�active_childrenrrr r%r(r*r-r/r0r2r7r:r;r<rCrGrIrKrNrSrUrXrZr\rrhrk�propertyro�setterrbrrrrrsT










�






rc@s(eZdZdZedd��Zedd��ZdS)�ProcessNcCst��j�|�Srd)�_default_contextrry�_Popen)�process_objrrrr{�szProcess._PopencCst��j��Srd)rzrry�_after_forkrrrrr}�rpzProcess._after_fork�r	r
r�
_start_methodrsr{r}rrrrry�s
rycsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrd)rz�_actual_context)rr=rrr�__init__�s
zDefaultContext.__init__Ncs,|dur|jdur
|j|_|jSt��|�Srd)r�rz�superr)rrc��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdur|std��|dur|rd|_dS|�|�|_dS)Nzcontext has already been set)r��RuntimeErrorrrirrrrk�szDefaultContext.set_start_methodcCs"|jdur
|r	dS|j|_|jjSrd)r�rzrerfrrrrh�s

zDefaultContext.get_start_methodcCs>tjdkrdgStjdkrddgnddg}tjr|�d�|S)NrLrR�darwin�forkr])rOrPr�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methodsrdrr)
r	r
rryr�rrkrhr��
__classcell__rrr�rr��s

r�rLc@�eZdZdZedd��ZdS)�ForkProcessr�cC�ddlm}||�S�Nr)�Popen)�
popen_forkr��r|r�rrrr{r#zForkProcess._PopenN�r	r
rrrsr{rrrrr��r�c@�(eZdZdZedd��Zedd��ZdS)�SpawnProcessrRcCr�r�)�popen_spawn_posixr�r�rrrr{r#�SpawnProcess._PopencCrqrdrrrrrr}"��SpawnProcess._after_forkNr~rrrrr��
r�c@r�)�ForkServerProcessr]cCr�r�)�popen_forkserverr�r�rrrr{)r#zForkServerProcess._PopenNr�rrrrr�'r�r�c@�eZdZdZeZdS)�ForkContextr�N)r	r
rrer�ryrrrrr�.�r�c@r���SpawnContextrRN�r	r
rrer�ryrrrrr�2r�r�c@seZdZdZeZdd�ZdS)�ForkServerContextr]cCstjstd��dS)Nz%forkserver start method not available)rr�rarnrrrrb9s�z"ForkServerContext._check_availableN)r	r
rrer�ryrbrrrrr�6sr�)r�rRr]r�rRr�c@r�)r�rRcCr�r�)�popen_spawn_win32r�r�rrrr{Mr#r�cCrqrdrrrrrr}Rr�r�Nr~rrrrr�Kr�c@r�r�r�rrrrr�Wr�cCst|t_dSrd)r_rzr�)rcrrr�_force_start_methoddsr�cCsttdd�S)N�spawning_popen)rQ�_tlsrrrr�get_spawning_popenmsr�cCs
|t_dSrd)r�r�)�popenrrr�set_spawning_popenps
r�cCs t�durtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r�r��typer	)�objrrr�assert_spawningss
���r�) rrO�	threadingrWrr�__all__�	Exceptionrrrr�objectr�BaseProcessryr�rPr�r�r�r�r�r�r_rzr��localr�r�r�r�rrrr�<module>sL?

,�
�
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