Your IP : 13.58.77.244


Current Path : /opt/alt/python35/lib64/python3.5/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/multiprocessing/__pycache__/context.cpython-35.opt-2.pyc



���]�)�@sWddlZddlZddlZddlmZgZGdd�de�ZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�dej
�ZGdd�de�Zedd�ee�D��e_ejdkr�Gdd�dej
�ZGdd�dej
�ZGdd�dej
�ZGdd�de�ZGdd�de�ZGdd �d e�Zd!e�d"e�d#e�iZeed!�ZnNGd$d�dej
�ZGd%d�de�Zd"e�iZeed"�Zd&d'�Zej�Zd(d)�Zd*d+�Zd,d-�Z dS).�N�)�processc@seZdZdS)�ProcessErrorN)�__name__�
__module__�__qualname__�rr�,/opt/alt/python35/lib64/python3.5/context.pyr
src@seZdZdS)�BufferTooShortN)rrrrrrr	r
sr
c@seZdZdS)�TimeoutErrorN)rrrrrrr	rsrc@seZdZdS)�AuthenticationErrorN)rrrrrrr	rsrc@s�eZdZeZeZeZeZeej	�Z	eej
�Z
dd�Zdd�Zddd�Z
dd	�Zd
d�Zdd
d�Zddd�Zddd�Zdd�Zdddd�Zddd�Zddd�Zdd�Zddfddd �Zd!d"�Zd#d$�Zd%dd&d'�Zd%dd(d)�Zd*d+�Zd,d-�Zdd.d/�Zd0d1�Z d2d3�Z!d4d5�Z"dd6d7�Z#d8d9d:�Z$d8d;d<�Z%d=d>�Z&dS)?�BaseContextcCs/tj�}|dkr'td��n|SdS)Nzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�self�numrrr	r'szBaseContext.cpu_countcCs3ddlm}|d|j��}|j�|S)Nr)�SyncManager�ctx)�managersr�get_context�start)rr�mrrr	�Manager/s
zBaseContext.ManagerTcCsddlm}||�S)Nr)�Pipe)�
connectionr)r�duplexrrrr	r:szBaseContext.PipecCs#ddlm}|d|j��S)Nr)�Lockr)�synchronizerr)rrrrr	r?szBaseContext.LockcCs#ddlm}|d|j��S)Nr)�RLockr)rrr)rrrrr	rDszBaseContext.RLockNcCs&ddlm}||d|j��S)Nr)�	Conditionr)rr r)r�lockr rrr	r IszBaseContext.ConditionrcCs&ddlm}||d|j��S)Nr)�	Semaphorer)rr"r)r�valuer"rrr	r"NszBaseContext.SemaphorecCs&ddlm}||d|j��S)Nr)�BoundedSemaphorer)rr$r)rr#r$rrr	r$SszBaseContext.BoundedSemaphorecCs#ddlm}|d|j��S)Nr)�Eventr)rr%r)rr%rrr	r%XszBaseContext.EventcCs,ddlm}||||d|j��S)Nr)�Barrierr)rr&r)r�parties�action�timeoutr&rrr	r&]szBaseContext.BarrierrcCs&ddlm}||d|j��S)Nr)�Queuer)�queuesr*r)r�maxsizer*rrr	r*bszBaseContext.QueuecCs&ddlm}||d|j��S)Nr)�
JoinableQueuer)r+r-r)rr,r-rrr	r-gszBaseContext.JoinableQueuecCs#ddlm}|d|j��S)Nr)�SimpleQueuer)r+r.r)rr.rrr	r.lszBaseContext.SimpleQueuecCs/ddlm}|||||d|j��S)Nr)�Pool�context)�poolr/r)r�	processes�initializer�initargs�maxtasksperchildr/rrr	r/qszBaseContext.PoolcGsddlm}|||�S)Nr)�RawValue)�sharedctypesr6)r�typecode_or_type�argsr6rrr	r6xszBaseContext.RawValuecCsddlm}|||�S)Nr)�RawArray)r7r:)rr8�size_or_initializerr:rrr	r:}szBaseContext.RawArrayr!cGs/ddlm}|||d|d|j��S)Nr)�Valuer!r)r7r<r)rr8r!r9r<rrr	r<�szBaseContext.ValuecCs/ddlm}|||d|d|j��S)Nr)�Arrayr!r)r7r=r)rr8r;r!r=rrr	r=�szBaseContext.ArraycCs<tjdkr8ttdd�r8ddlm}|�dS)N�win32�frozenFr)�freeze_support)�sys�platform�getattr�spawnr@)rr@rrr	r@�s!zBaseContext.freeze_supportcCsddlm}|�S)Nr)�
get_logger)�utilrE)rrErrr	rE�szBaseContext.get_loggercCsddlm}||�S)Nr)�
log_to_stderr)rFrG)r�levelrGrrr	rG�szBaseContext.log_to_stderrcCsddlm}dS)Nr)r)�r)rrrrr	�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)Nr)�set_executable)rDrK)r�
executablerKrrr	rK�szBaseContext.set_executablecCsddlm}||�dS)Nr)�set_forkserver_preload)�
forkserverrM)r�module_namesrMrrr	rM�sz"BaseContext.set_forkserver_preloadcCsQ|dkr|Syt|}Wn"tk
rBtd|��YnX|j�|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��dS)Nz+cannot set start method of concrete context)rR)rrT�forcerrr	�set_start_method�szBaseContext.set_start_methodcCsdS)Nr)rrrr	rS�szBaseContext._check_available)'rrrrr
rr�staticmethodr�current_process�active_childrenrrrrrr r"r$r%r&r*r-r.r/r6r:r<r=r@rErGrJrKrMrrWrYrSrrrr	r
sF	
r
c@s(eZdZdZedd��ZdS)�ProcessNcCstj�jj|�S)N)�_default_contextrr]�_Popen)�process_objrrr	r_�szProcess._Popen)rrr�
_start_methodrZr_rrrr	r]�sr]csaeZdZeZdd�Zd�fdd�Zddd�Zdd	d
�Zdd�Z�S)
�DefaultContextcCs||_d|_dS)N)r^�_actual_context)rr0rrr	�__init__�s	zDefaultContext.__init__NcsB|dkr.|jdkr'|j|_|jSt�j|�SdS)N)rcr^�superr)rrT)�	__class__rr	r�s
zDefaultContext.get_contextFcCsW|jdk	r"|r"td��|dkrA|rAd|_dS|j|�|_dS)Nzcontext has already been set)rc�RuntimeErrorr)rrTrXrrr	rY�s	zDefaultContext.set_start_methodcCs/|jdkr%|rdS|j|_|jjS)N)rcr^rU)rrVrrr	rW�s
zDefaultContext.get_start_methodcCsJtjdkrdgSddlm}|jr<dddgSddgSdS)Nr>rDr)�	reduction�forkrN)rArBrIrh�HAVE_SEND_HANDLE)rrhrrr	�get_all_start_methods�s	
z$DefaultContext.get_all_start_methods)	rrrr]rdrrYrWrkrr)rfr	rb�srbccs%|]}|ddkr|VqdS)r�_Nr)�.0�xrrr	�	<genexpr>�sror>c@s(eZdZdZedd��ZdS)�ForkProcessricCsddlm}||�S)Nr)�Popen)�
popen_forkrq)r`rqrrr	r_szForkProcess._PopenN)rrrrarZr_rrrr	rpsrpc@s(eZdZdZedd��ZdS)�SpawnProcessrDcCsddlm}||�S)Nr)rq)�popen_spawn_posixrq)r`rqrrr	r_szSpawnProcess._PopenN)rrrrarZr_rrrr	rs
srsc@s(eZdZdZedd��ZdS)�ForkServerProcessrNcCsddlm}||�S)Nr)rq)�popen_forkserverrq)r`rqrrr	r_szForkServerProcess._PopenN)rrrrarZr_rrrr	rusruc@seZdZdZeZdS)�ForkContextriN)rrrrUrpr]rrrr	rwsrwc@seZdZdZeZdS)�SpawnContextrDN)rrrrUrsr]rrrr	rxsrxc@s(eZdZdZeZdd�ZdS)�ForkServerContextrNcCs)ddlm}|js%td��dS)Nr)rhz%forkserver start method not available)rIrhrjrR)rrhrrr	rS&s	z"ForkServerContext._check_availableN)rrrrUrur]rSrrrr	ry#sryrirDrNc@s(eZdZdZedd��ZdS)rsrDcCsddlm}||�S)Nr)rq)Zpopen_spawn_win32rq)r`rqrrr	r_6szSpawnProcess._PopenN)rrrrarZr_rrrr	rs4sc@seZdZdZeZdS)rxrDN)rrrrUrsr]rrrr	rx;scCst|t_dS)N)rPr^rc)rTrrr	�_force_start_methodHsrzcCsttdd�S)N�spawning_popen)rC�_tlsrrrr	�get_spawning_popenQsr}cCs
|t_dS)N)r|r{)�popenrrr	�set_spawning_popenTsrcCs,t�dkr(tdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r}rg�typer)�objrrr	�assert_spawningWsr�)!rrA�	threadingrIr�__all__�	Exceptionrr
rr�objectr
�BaseProcessr]rb�list�dirrBrprsrurwrxryrPr^rz�localr|r}rr�rrrr	�<module>s@�("			

?>