AlkantarClanX12

Your IP : 3.145.81.252


Current Path : /opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/multiprocessing/__pycache__/context.cpython-37.opt-2.pyc

B

YI~d�*�@s�ddlZddlZddlZddlmZddlmZgZGdd�de�ZGdd�de�Z	Gd	d
�d
e�Z
Gdd�de�ZGd
d�de�Z
Gdd�dej�ZGdd�de
�Zdd�ee�D�e_ejdk�rLGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGd d!�d!e
�Ze�e�e�d"�Zeed#�Zn8Gd$d�dej�ZGd%d�de
�Zd&e�iZeed&�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�Z dS)/�N�)�process)�	reductionc@seZdZdS)�ProcessErrorN)�__name__�
__module__�__qualname__�r	r	�</opt/alt/python37/lib64/python3.7/multiprocessing/context.pyrsrc@seZdZdS)�BufferTooShortN)rrrr	r	r	r
rsrc@seZdZdS)�TimeoutErrorN)rrrr	r	r	r
rsrc@seZdZdS)�AuthenticationErrorN)rrrr	r	r	r
r
sr
c@sNeZdZeZeZeZeZeej	�Z	eej
�Z
dd�Zdd�ZdCdd�Z
dd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Zd1d2�Z d3d4�Z!d5d6�Z"dLd7d8�Z#dMd:d;�Z$dNd<d=�Z%e&d>d?��Z'e'j(d@d?��Z'dAdB�Z)dS)O�BaseContextcCs"t��}|dkrtd��n|SdS)Nzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�selfZnumr	r	r
r(s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)Nr)�SyncManager)�ctx)Zmanagersr�get_context�start)rr�mr	r	r
�Manager0szBaseContext.ManagerTcCsddlm}||�S)Nr)�Pipe)�
connectionr)rZduplexrr	r	r
r;szBaseContext.PipecCsddlm}||��d�S)Nr)�Lock)r)�synchronizerr)rrr	r	r
r@szBaseContext.LockcCsddlm}||��d�S)Nr)�RLock)r)rrr)rrr	r	r
rEszBaseContext.RLockNcCsddlm}|||��d�S)Nr)�	Condition)r)rrr)r�lockrr	r	r
rJszBaseContext.ConditionrcCsddlm}|||��d�S)Nr)�	Semaphore)r)rr r)r�valuer r	r	r
r OszBaseContext.SemaphorecCsddlm}|||��d�S)Nr)�BoundedSemaphore)r)rr"r)rr!r"r	r	r
r"TszBaseContext.BoundedSemaphorecCsddlm}||��d�S)Nr)�Event)r)rr#r)rr#r	r	r
r#YszBaseContext.EventcCs ddlm}|||||��d�S)Nr)�Barrier)r)rr$r)rZparties�actionZtimeoutr$r	r	r
r$^szBaseContext.BarrierrcCsddlm}|||��d�S)Nr)�Queue)r)�queuesr&r)r�maxsizer&r	r	r
r&cszBaseContext.QueuecCsddlm}|||��d�S)Nr)�
JoinableQueue)r)r'r)r)rr(r)r	r	r
r)hszBaseContext.JoinableQueuecCsddlm}||��d�S)Nr)�SimpleQueue)r)r'r*r)rr*r	r	r
r*mszBaseContext.SimpleQueuer	cCs"ddlm}||||||��d�S)Nr)�Pool)�context)Zpoolr+r)rZ	processesZinitializerZinitargsZmaxtasksperchildr+r	r	r
r+rs
zBaseContext.PoolcGsddlm}||f|��S)Nr)�RawValue)�sharedctypesr-)r�typecode_or_type�argsr-r	r	r
r-yszBaseContext.RawValuecCsddlm}|||�S)Nr)�RawArray)r.r1)rr/�size_or_initializerr1r	r	r
r1~szBaseContext.RawArray)rcGs&ddlm}||f|�||��d��S)Nr)�Value)rr)r.r3r)rr/rr0r3r	r	r
r3�szBaseContext.ValuecCs ddlm}|||||��d�S)Nr)�Array)rr)r.r4r)rr/r2rr4r	r	r
r4�szBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)N�win32�frozenFr)�freeze_support)�sys�platform�getattr�spawnr7)rr7r	r	r
r7�szBaseContext.freeze_supportcCsddlm}|�S)Nr)�
get_logger)�utilr<)rr<r	r	r
r<�szBaseContext.get_loggercCsddlm}||�S)Nr)�
log_to_stderr)r=r>)r�levelr>r	r	r
r>�szBaseContext.log_to_stderrcCsddlm}dS)Nr)r)�r)rrr	r	r
�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)Nr)�set_executable)r;rB)r�
executablerBr	r	r
rB�szBaseContext.set_executablecCsddlm}||�dS)Nr)�set_forkserver_preload)�
forkserverrD)rZmodule_namesrDr	r	r
rD�sz"BaseContext.set_forkserver_preloadcCsH|dkr|Syt|}Wn"tk
r:td|�d�YnX|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrr	r	r
r�szBaseContext.get_contextFcCs|jS)N)�_name)r�
allow_noner	r	r
�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rH)rrJ�forcer	r	r
�set_start_method�szBaseContext.set_start_methodcCst��d�S)Nr)�globals�get)rr	r	r
�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rP)rrr	r	r
rR�scCsdS)Nr	)rr	r	r
rI�szBaseContext._check_available)T)N)r)r)NN)r)r)NNr	N)N)N)F)F)*rrrrrrr
�staticmethodrZcurrent_processZactive_childrenrrrrrrr r"r#r$r&r)r*r+r-r1r3r4r7r<r>rArBrDrrMrO�propertyrR�setterrIr	r	r	r
rsJ














rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�S)N)�_default_contextrrV�_Popen)�process_objr	r	r
rX�szProcess._Popen)rrr�
_start_methodrSrXr	r	r	r
rV�srVcsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dS)N)rW�_actual_context)rr,r	r	r
�__init__�szDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt��|�SdS)N)r\rW�superr)rrJ)�	__class__r	r
r�s

zDefaultContext.get_contextFcCs<|jdk	r|std��|dkr,|r,d|_dS|�|�|_dS)Nzcontext has already been set)r\�RuntimeErrorr)rrJrNr	r	r
rO�szDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjS)N)r\rWrK)rrLr	r	r
rM�s

zDefaultContext.get_start_methodcCs,tjdkrdgStjr dddgSddgSdS)Nr5r;�forkrE)r8r9r�HAVE_SEND_HANDLE)rr	r	r
�get_all_start_methods�s


z$DefaultContext.get_all_start_methods)N)F)F)
rrrrVr]rrOrMrc�
__classcell__r	r	)r_r
r[�s

r[cCsg|]}|ddkr|�qS)r�_r	)�.0�xr	r	r
�
<listcomp>srhr5c@seZdZdZedd��ZdS)�ForkProcessracCsddlm}||�S)Nr)�Popen)Z
popen_forkrj)rYrjr	r	r
rXszForkProcess._PopenN)rrrrZrSrXr	r	r	r
risric@seZdZdZedd��ZdS)�SpawnProcessr;cCsddlm}||�S)Nr)rj)Zpopen_spawn_posixrj)rYrjr	r	r
rXszSpawnProcess._PopenN)rrrrZrSrXr	r	r	r
rksrkc@seZdZdZedd��ZdS)�ForkServerProcessrEcCsddlm}||�S)Nr)rj)Zpopen_forkserverrj)rYrjr	r	r
rX szForkServerProcess._PopenN)rrrrZrSrXr	r	r	r
rlsrlc@seZdZdZeZdS)�ForkContextraN)rrrrKrirVr	r	r	r
rm%srmc@seZdZdZeZdS)�SpawnContextr;N)rrrrKrkrVr	r	r	r
rn)srnc@seZdZdZeZdd�ZdS)�ForkServerContextrEcCstjstd��dS)Nz%forkserver start method not available)rrbrH)rr	r	r
rI0sz"ForkServerContext._check_availableN)rrrrKrlrVrIr	r	r	r
ro-sro)rar;rErac@seZdZdZedd��ZdS)rkr;cCsddlm}||�S)Nr)rj)Zpopen_spawn_win32rj)rYrjr	r	r
rX?szSpawnProcess._PopenN)rrrrZrSrXr	r	r	r
rk=sc@seZdZdZeZdS)rnr;N)rrrrKrkrVr	r	r	r
rnDsr;cCst|t_dS)N)rFrWr\)rJr	r	r
�_force_start_methodQsrpcCsttdd�S)N�spawning_popen)r:�_tlsr	r	r	r
�get_spawning_popenZsrscCs
|t_dS)N)rrrq)�popenr	r	r
�set_spawning_popen]srucCs t�dkrtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)rsr`�typer)�objr	r	r
�assert_spawning`s
rx)!rr8Z	threadingr@rr�__all__�	Exceptionrrrr
�objectrZBaseProcessrVr[�dirr9rirkrlrmrnrorFrWrpZlocalrrrsrurxr	r	r	r
�<module>sD>'