HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/multiprocessing/__pycache__/context.cpython-310.pyc
o

�N�gM-�@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�=/opt/saltstack/salt/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)Zmanagersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcC�ddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr)rZduplexrrrr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$r.r)rr.rrrr.Zr%zBaseContext.EventcC� ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)r$r0r)r�parties�action�timeoutr0rrrr0_szBaseContext.BarrierrcCr')�Returns a queue objectr)�Queuer)�queuesr5r)r�maxsizer5rrrr5dr*zBaseContext.QueuecCr')r4r)�
JoinableQueuer)r6r8r)rr7r8rrrr8ir*zBaseContext.JoinableQueuecCr")r4r)�SimpleQueuer)r6r9r)rr9rrrr9nr%zBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)�poolr:r)rZ	processesZinitializerZinitargsZmaxtasksperchildr:rrrr:ss
�zBaseContext.PoolcGsddlm}||g|�R�S)zReturns a shared objectr)�RawValue)�sharedctypesr=)r�typecode_or_type�argsr=rrrr=zr*zBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)r>rA)rr?�size_or_initializerrArrrrAs
zBaseContext.RawArray)r)cGs(ddlm}||g|�R||��d��S)z$Returns a synchronized shared objectr)�Value�r)r)r>rCr)rr?r)r@rCrrrrC�s�zBaseContext.ValuecCr/)z#Returns a synchronized shared arrayr)�ArrayrD)r>rEr)rr?rBr)rErrrrE�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�spawnrH)rrHrrrrH�s
�zBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrM)rrMrrrrM�szBaseContext.get_loggercCr)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rNrO)r�levelrOrrrrO�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)rLrT)r�
executablerTrrrrT�szBaseContext.set_executablecCrS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrV)rZmodule_namesrVrrrrV�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�rZ
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��)Nz+cannot set start method of concrete context)rZ�rr\�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)rd)rrrrrrg��cC�dSr]rrfrrrr[�szBaseContext._check_available)Tr])r)NN)r)NNrN�F)+r	r
rrrrr�staticmethodr�current_processZparent_processZactive_childrenrrrr#r&r(r+r-r.r0r5r8r9r:r=rArCrErHrMrOrRrTrVrr`rc�propertyrg�setterr[rrrrrsT










�






rc@s(eZdZdZedd��Zedd��ZdS)�ProcessNcCst��j�|�Sr])�_default_contextrro�_Popen)�process_objrrrrq�szProcess._PopencCst��j��Sr])rprro�_after_forkrrrrrs�rhzProcess._after_fork�r	r
r�
_start_methodrkrqrsrrrrro�s
rocsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSr])rp�_actual_context)rr;rrr�__init__�s
zDefaultContext.__init__Ncs,|dur|jdur
|j|_|jSt��|�Sr])rwrp�superr)rr\��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdur|std��|dur|rd|_dS|�|�|_dS)Nzcontext has already been set)rw�RuntimeErrorrrarrrrc�szDefaultContext.set_start_methodcCs"|jdur
|r	dS|j|_|jjSr])rwrpr^r_rrrr`�s

zDefaultContext.get_start_methodcCs>tjdkrdgStjdkrddgnddg}tjr|�d�|S)NrFrL�darwin�forkrW)rIrJr�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methodsr]rj)
r	r
rrorxrrcr`r��
__classcell__rrrzrrv�s

rvrFc@�eZdZdZedd��ZdS)�ForkProcessr~cC�ddlm}||�S�Nr)�Popen)Z
popen_forkr��rrr�rrrrqr!zForkProcess._PopenN�r	r
rrurkrqrrrrr��r�c@�(eZdZdZedd��Zedd��ZdS)�SpawnProcessrLcCr�r�)Zpopen_spawn_posixr�r�rrrrqr!�SpawnProcess._PopencCrir]rrrrrrs"��SpawnProcess._after_forkNrtrrrrr��
r�c@r�)�ForkServerProcessrWcCr�r�)Zpopen_forkserverr�r�rrrrq)r!zForkServerProcess._PopenNr�rrrrr�'r�r�c@�eZdZdZeZdS)�ForkContextr~N)r	r
rr^r�rorrrrr�.�r�c@r���SpawnContextrLN�r	r
rr^r�rorrrrr�2r�r�c@seZdZdZeZdd�ZdS)�ForkServerContextrWcCstjstd��dS)Nz%forkserver start method not available)rrrZrfrrrr[9s�z"ForkServerContext._check_availableN)r	r
rr^r�ror[rrrrr�6sr�)r~rLrWr}rLr~c@r�)r�rLcCr�r�)Zpopen_spawn_win32r�r�rrrrqMr!r�cCrir]rrrrrrsRr�r�Nrtrrrrr�Kr�c@r�r�r�rrrrr�Wr�cCst|t_dSr])rXrprw)r\rrr�_force_start_methoddsr�cCsttdd�S)N�spawning_popen)rK�_tlsrrrr�get_spawning_popenmsr�cCs
|t_dSr])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�) rrI�	threadingrQrr�__all__�	Exceptionrrrr�objectrZBaseProcessrorvrJr�r�r�r�r�r�rXrpr��localr�r�r�r�rrrr�<module>sL?

,�
�