Your IP : 3.137.177.116


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



��Yf{��@s�ddddgZddlZddlZddlZddlZddlmZddlmZdd	l	m
Z
dd
l	mZddl	mZddl	m
Z
dd
l	mZddl	mZddl	mZdd�Zejeje�dd�dddfD�Zedek	rJdd�ZxeD]Zejee�q0WGdd�de�Zfidd�Zdd�ZGdd�de�Zd d!�Zd"d#�ZGd$d%�d%e�ZGd&d'�d'e�Z d(e
j!e
j"fd)e
j#e
j$fiZ%Gd*d�de�Z&Gd+d,�d,e'�Z(Gd-d�de�Z)d.d/�Z*id0d1�Z+dddd2d3d4�Z,Gd5d6�d6e�Z-Gd7d8�d8e�Z.d2d9d:�Z/Gd;d<�d<e)�Z0Gd=d>�d>e)�Z1Gd?d@�d@e1�Z2GdAdB�dBe)�Z3GdCdD�dDe)�Z4GdEdF�dFe)�Z5GdGdH�dHe)�Z6e+dIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\f�Z7Gd]d^�d^e7�Z8e+d_dKdLdMdNdRd`dadbdcdddXdddedfdf�Z9e+dgdNdMdRf�Z:e+dhdidjdkdldmdndodpdqdrdsf�Z;djdtdpdtdrdtdldudmduie;_<Gdvdh�dhe;�Z=Gdwd�de&�Z>e>jdxej?�e>jdyej?�e>jdzej@e3�e>jd{ejAe1�e>jd|ejBe1�e>jd}ejCe1�e>jd~ejDe1�e>jdejEe2�e>jd�ejFe4�e>jd�ejGe=�e>jd�ee8�e>jd�eHe9�e>jd8e.e6�e>jd:e/e:�e>jd6e-e5�e>jdud�e0d�d��e>jdtd�d��dS)��BaseManager�SyncManager�	BaseProxy�Token�N)�time)�
format_exc�)�
connection)�context)�pool)�process)�	reduction)�util)�get_contextcCstj|j|j�ffS)N)�array�typecode�tobytes)�a�r�=/opt/alt/python35/lib64/python3.5/multiprocessing/managers.py�reduce_array%srcCs(g|]}tti|����qSr)�type�getattr)�.0�namerrr�
<listcomp>)s	r�items�keys�valuescCstt|�ffS)N)�list)�objrrr�rebuild_as_list+sr!c@sLeZdZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)rz4
    Type to uniquely indentify a shared object
    �typeid�address�idcCs!||||_|_|_dS)N)r"r#r$)�selfr"r#r$rrr�__init__:szToken.__init__cCs|j|j|jfS)N)r"r#r$)r%rrr�__getstate__=szToken.__getstate__cCs|\|_|_|_dS)N)r"r#r$)r%�staterrr�__setstate__@szToken.__setstate__cCs#d|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r))�	__class__�__name__r"r#r$)r%rrr�__repr__CszToken.__repr__N)r"r#r$)	r+�
__module__�__qualname__�__doc__�	__slots__r&r'r)r,rrrrr4scCsN|j||||f�|j�\}}|dkr;|St||��dS)zL
    Send a message to manager using connection `c` and return response
    z#RETURNN)�send�recv�convert_to_error)�cr$�
methodname�args�kwds�kind�resultrrr�dispatchKs
r:cCs~|dkr|S|dkr>t|�tks4t�t|�S|dkrpt|�tksbt�td|�Std�SdS)Nz#ERRORz
#TRACEBACKz#UNSERIALIZABLEzUnserializable message: %s
zUnrecognized message type)r�str�AssertionError�RemoteError�
ValueError)r8r9rrrr3Us
r3c@seZdZdd�ZdS)r=cCs)ddddt|jd�ddS)N�
�-�Kr)r;r6)r%rrr�__str__bszRemoteError.__str__N)r+r-r.rBrrrrr=asr=cCsIg}x<t|�D].}t||�}t|�r|j|�qW|S)z4
    Return a list of names of methods of `obj`
    )�dirr�callable�append)r �tempr�funcrrr�all_methodsisrHcCsdd�t|�D�S)zP
    Return a list of names of methods of `obj` which do not start with '_'
    cSs&g|]}|ddkr|�qS)r�_r)rrrrrrxs	z"public_methods.<locals>.<listcomp>)rH)r rrr�public_methodstsrJc	@seZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdedede
iZ
dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0S)1�ServerzM
    Server class which runs in a process controlled by a manager object
    �shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefcCs�t|t�st�||_tj|�|_t|\}}|d|dd�|_|jj	|_	ddffi|_
i|_tj
�|_dS)Nr#Zbacklog��0)�
isinstance�bytesr<�registryr�AuthenticationString�authkey�listener_client�listenerr#�	id_to_obj�id_to_refcount�	threading�RLock�mutex)r%rYr#r[�
serializer�Listener�Clientrrrr&�s		zServer.__init__cCs�tj�|_|tj�_zqtjd|j�}d|_|j	�y*x#|jj
�sq|jjd�qOWWntt
fk
r�YnXWdtjtjkr�tjd�tjt_tjt_tjd�XdS)z(
        Run the server forever
        �targetTrNzresetting stdout, stderrr)r`�Event�
stop_eventr�current_process�_manager_server�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit�sys�stdout�
__stdout__r�debug�
__stderr__�stderr�exit)r%rlrrr�
serve_forever�s 	
	
zServer.serve_foreverc
Csgx`y|jj�}Wntk
r-wYnXtjd|jd|f�}d|_|j�qWdS)Nrfr6T)r]Zaccept�OSErrorr`rk�handle_requestrmrn)r%r4�trrrrl�s
	zServer.accepterc'Cs�d}}}yvtj||j�tj||j�|j�}|\}}}}||jksttd|��t||�}Wn!tk
r�dt	�f}	YnGXy||||�}Wn!tk
r�dt	�f}	Yn
Xd|f}	y|j
|	�Wn�tk
r�}
zdy|j
dt	�f�Wntk
rBYnXtjd|	�tjd|�tjd|
�WYdd}
~
XnX|j
�dS)z)
        Handle a new connection
        Nz%r unrecognizedz
#TRACEBACKz#RETURNzFailure to send message: %rz ... request was %rz ... exception was %r)r	Zdeliver_challenger[Zanswer_challenger2�publicr<r�	Exceptionrr1r�info�close)r%r4�funcnamer9�request�ignorer6r7rG�msg�errrr|�s4


#zServer.handle_requestc*Cs%tjdtj�j�|j}|j}|j}x�|jj	�s y,d}}|�}|\}}}	}
||\}}}||kr�t
d|t|�|f��t||�}
y|
|	|
�}Wn1t
k
r}zd|f}WYdd}~XnpX|o|j|d�}|re|j|||�\}}t||j|�}d||ff}nd|f}Wn�t
k
r|dkr�dt�f}n\y8|j|}||||||	|
�}d|f}Wn!t
k
r�dt�f}YnXYnXtk
r7tjdtj�j�tjd	�Yn!t
k
rWdt�f}YnXyMy||�Wn8t
k
r�}z|d
t�f�WYdd}~XnXWq7t
k
r}zUtjdtj�j�tjd|�tjd
|�|j�tjd�WYdd}~Xq7Xq7WdS)zQ
        Handle requests from the proxies in a particular process/thread
        z$starting server thread to service %rNz+method %r of %r object is not in exposed=%rz#ERRORz#PROXYz#RETURNz
#TRACEBACKz$got EOF -- exiting thread serving %rrz#UNSERIALIZABLEzexception in thread serving %rz ... message was %rz ... exception was %rr)rrvr`�current_threadrr2r1r^rhro�AttributeErrorrrr�getrMrr#r�fallback_mapping�EOFErrorrsryr�r�)r%�connr2r1r^r5r r��identr6r7�exposedZ	gettypeidZfunction�resr�r�r"ZridentZrexposed�tokenZ
fallback_funcr9rrr�serve_client�sl				
	



	
*	
zServer.serve_clientcCs|S)Nr)r%r�r�r rrr�fallback_getvalueszServer.fallback_getvaluecCs
t|�S)N)r;)r%r�r�r rrr�fallback_str"szServer.fallback_strcCs
t|�S)N)�repr)r%r�r�r rrr�
fallback_repr%szServer.fallback_reprrBr,z	#GETVALUEcCsdS)Nr)r%r4rrrrR.szServer.dummycCs�|j��g}t|jj��}|j�xV|D]N}|dkr6|jd||j|t|j|d�dd�f�q6Wdj|�SWdQRXdS)zO
        Return some info --- useful to spot problems with refcounting
        rVz  %s:       refcount=%s
    %srNrAr?)	rbrr^r�sortrEr_r;�join)r%r4r9rr�rrrrP1s


	
*zServer.debug_infocCst|j�dS)z*
        Number of shared objects
        r)�lenr^)r%r4rrrrQ@szServer.number_of_objectscCsXzCytjd�|jd�Wnddl}|j�YnXWd|jj�XdS)z'
        Shutdown this process
        z!manager received shutdown message�#RETURNNr)r�N)rrvr1�	traceback�	print_excrh�set)r%r4r�rrrrLFs
zServer.shutdowncOsB|j�2|j|\}}}}|dkr[t|�dkrH|sNt�|d}	n|||�}	|dkr�t|	�}|dk	r�t|�tks�t�t|�t|�}dt|	�}
t	j
d||
�|	t|�|f|j|
<|
|j
krd|j
|
<|j||
�|
t|�fSWdQRXdS)z>
        Create a new shared object and return its id
        Nrrz%xz&%r callable returned object with id %r)rbrYr�r<rJr�dictrr$rrvr�r^r_rS�tuple)r%r4r"r6r7rDr��method_to_typeid�	proxytyper r�rrrrMSs$


z
Server.createcCst|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r)r�r^r$)r%r4r�rrrrOvszServer.get_methodscCs-|tj�_|jd�|j|�dS)z=
        Spawn a new thread to serve this connection
        �#RETURNN)r�N)r`r�rr1r�)r%r4rrrrrN|s
zServer.accept_connectioncCs&|j�|j|d7<WdQRXdS)Nr)rbr_)r%r4r�rrrrS�s
z
Server.increfcCsv|j�f|j|dks#t�|j|d8<|j|dkrk|j|=|j|=tjd|�WdQRXdS)Nrrzdisposing of obj with id %r)rbr_r<r^rrv)r%r4r�rrrrT�s
z
Server.decrefN)r+r-r.r/r~r&rzrlr|r�r�r�r�r�rRrPrQrLrMrOrNrSrTrrrrrK~s.
"J
#rKc@s+eZdZdgZdZdZdZdS)�State�valuerr�N)r+r-r.r0�INITIAL�STARTED�SHUTDOWNrrrrr��s	r��pickleZ	xmlrpclibc@seZdZdZiZeZdddddd�Zdd�Zdd	�Z	dfd
d�Z
edfdd
��Zdd�Z
ddd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zeddddddd ��ZdS)!rz!
    Base class for managers
    Nr�cCs�|dkrtj�j}||_tj|�|_t�|_tj|j_	||_
t|\|_|_
|p|t�|_dS)N)rrir[�_addressrZ�_authkeyr��_stater�r��_serializerr\Z	_Listener�_Clientr�_ctx)r%r#r[rcZctxrrrr&�s		zBaseManager.__init__cCs:|jjtjkst�t|j|j|j|j	�S)zX
        Return server object with serve_forever() method and address attribute
        )
r�r�r�r�r<rK�	_registryr�r�r�)r%rrr�
get_server�szBaseManager.get_servercCsNt|j\}}||jd|j�}t|dd�tj|j_dS)z>
        Connect manager object to the server process
        r[NrR)	r\r�r�r�r:r�r�r�r�)r%rdrer�rrr�connect�szBaseManager.connectcCsj|jjtjkst�|dk	r@t|�r@td��tjdd�\}}|j	j
dt|�jd|j
|j|j|j|||f�|_djdd	�|jjD��}t|�jd
||j_|jj�|j�|j�|_|j�tj|j_tj|t|�jd|j|j|j|j|jfdd�|_dS)
z@
        Spawn a server process for this manager object
        Nzinitializer must be a callableZduplexFrfr6�:css|]}t|�VqdS)N)r;)r�irrr�	<genexpr>�sz$BaseManager.start.<locals>.<genexpr>r@�exitpriorityr)r�r�r�r�r<rD�	TypeErrorr	ZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr+rrnr�r2r�r�Finalize�_finalize_managerr�rL)r%�initializer�initargs�reader�writerr�rrrrn�s("


zBaseManager.startc	Csi|dk	r||�|j||||�}|j|j�|j�tjd|j�|j�dS)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)�_Serverr1r#r�rr�rz)	�clsrYr#r[rcr�r�r��serverrrrr��s

zBaseManager._run_servercOs�|jjtjks!td��|j|jd|j�}z)t|dd|f||�\}}Wd|j	�Xt
||j|�|fS)zP
        Create a new shared object; return the token and exposed tuple
        zserver not yet startedr[NrM)r�r�r�r�r<r�r�r�r:r�r)r%r"r6r7r�r$r�rrr�_creates!)zBaseManager._createcCs;|jdk	r7|jj|�|jj�s7d|_dS)zC
        Join the manager process (if it has been spawned)
        N)r�r��is_alive)r%�timeoutrrrr�szBaseManager.joinc
CsA|j|jd|j�}zt|dd�SWd|j�XdS)zS
        Return some info about the servers shared objects and connections
        r[NrP)r�r�r�r:r�)r%r�rrr�_debug_infoszBaseManager._debug_infoc
CsA|j|jd|j�}zt|dd�SWd|j�XdS)z5
        Return the number of shared objects
        r[NrQ)r�r�r�r:r�)r%r�rrr�_number_of_objects"szBaseManager._number_of_objectscCs>|jjtjkr|j�|jjtjks:t�|S)N)r�r�r�r�rnr�r<)r%rrr�	__enter__,s
zBaseManager.__enter__cCs|j�dS)N)rL)r%�exc_type�exc_val�exc_tbrrr�__exit__2szBaseManager.__exit__cCs|j�r�tjd�y8||d|�}zt|dd�Wd|j�XWntk
reYnX|jdd�|j�r�tjd�t|d�r�tjd	�|j�|jdd
�|j�r�tjd�t	j
|_ytj
|=Wntk
rYnXdS)zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to managerr[NrLr�g�?zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�rr�r:r�rr��hasattrr�r�r�r�r�_address_to_local�KeyError)rr#r[r(r�r�rrrr�5s.






zBaseManager._finalize_managercCs|jS)N)r�)r%rrr�<lambda>UszBaseManager.<lambda>Tc
s!d|jkr!|jj�|_�dkr3t�|pHt�dd�}|p`t�dd�}|r�xdt|j��D]P\}}t|�tks�t	d|��t|�tks|t	d|��q|W|||�f|j�<|r��fdd�}	�|	_
t|�|	�dS)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_z%r is not a stringc	s�tjd��|j�||�\}}�||jd|d|jd|�}|j|jd|j�}t|dd|jf�|S)Nz)requesting creation of a shared %r object�managerr[r�rT)	rrvr�r�r�r�r#r:r$)r%r6r7r�Zexp�proxyr�)r�r"rrrFrsz"BaseManager.register.<locals>.temp)�__dict__r��copy�	AutoProxyrrrrr;r<r+�setattr)
r�r"rDr�r�r��
create_method�keyr�rFr)r�r"r�registerWs "&
	zBaseManager.register)r+r-r.r/r�rKr�r&r�r�rn�classmethodr�r�r�r�r�r�r��staticmethodr��propertyr#r�rrrrr�s*		$	

 	c@s(eZdZdd�Zdd�ZdS)�ProcessLocalSetcCstj|dd��dS)NcSs
|j�S)N)�clear)r rrrr��sz*ProcessLocalSet.__init__.<locals>.<lambda>)r�register_after_fork)r%rrrr&�szProcessLocalSet.__init__cCst|�ffS)N)r)r%rrr�
__reduce__�szProcessLocalSet.__reduce__N)r+r-r.r&r�rrrrr��sr�c@s�eZdZdZiZej�Zdddddd�Zdd�Z	fidd	�Z
d
d�Zdd
�Ze
dd��Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rz.
    A base for proxies of shared objects
    NTc
Cs*tj�Ntjj|jd�}|dkrStj�t�f}|tj|j<WdQRX|d|_|d|_	||_
|j
j|_||_
||_t|d|_|dk	r�tj|�|_n3|j
dk	r�|j
j|_ntj�j|_|r|j�tj|tj�dS)Nrr)r�_mutexr�r�r#rZForkAwareLocalr��_tls�_idset�_tokenr$�_id�_managerr�r\r�rrZr�rir[�_increfr��_after_fork)r%r�rcr�r[r�rSZ	tls_idsetrrrr&�s(


			
zBaseProxy.__init__cCs�tjd�tj�j}tj�jdkrH|dtj�j7}|j|jj	d|j
�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|r[rN)rrvrrirr`r�r�r�r#r�r:r�r	)r%rr�rrr�_connect�s
zBaseProxy._connectcCsEy|jj}WnAtk
rStjdtj�j�|j�|jj}YnX|j	|j
|||f�|j�\}}|dkr�|S|dkr2|\}}|jj
|jd
}	|jj|_|	||jd|jd|jd|�}
|j|jd|j�}t|dd	|jf�|
St||��dS)zW
        Try to call a method of the referrent and return a copy of the result
        z#thread %r does not own a connectionz#RETURNz#PROXYrr�r[r�NrT���)r�r	r�rrvr`r�rr�r1r�r2r�r�r"r�r#r�r�r�r:r$r3)r%r5r6r7r�r8r9r�r�r�r�rrr�_callmethod�s,
	
zBaseProxy._callmethodcCs
|jd�S)z9
        Get a copy of the value of the referent
        z	#GETVALUE)r�)r%rrr�	_getvalue�szBaseProxy._getvaluec
Cs�|j|jjd|j�}t|dd|jf�tjd|jj�|j	j
|j�|jor|jj}tj
|tjd|j|j||j|j	|jfdd�|_dS)Nr[rSz	INCREF %rr6r��
)r�r�r#r�r:r�rrvr$r��addr�r�r�r�_decrefr�Z_close)r%r�r(rrrr��szBaseProxy._increfcCs|j|j�|dks.|jtjkr�yEtjd|j�||jd|�}t|dd|jf�Wq�t	k
r�}ztjd|�WYdd}~Xq�Xntjd|j�|rt
|d�rtjdtj�j
�|jj�|`dS)Nz	DECREF %rr[rTz... decref failed %sz%DECREF %r -- manager already shutdownr	z-thread %r has no more proxies so closing conn)�discardr$r�r�r�rrvr#r:rr�r`r�rr	r�)r�r[r(ZtlsZidsetr�r�r�rrrr��s&	
zBaseProxy._decrefcCsTd|_y|j�Wn6tk
rO}ztjd|�WYdd}~XnXdS)Nzincref failed: %s)r�r�rrr�)r%r�rrrr�
s
	zBaseProxy._after_forkcCs�i}tj�dk	r%|j|d<t|dd�r`|j|d<tt|j|j|ffStt	|�|j|j|ffSdS)Nr[�_isautoFr�)
r
Zget_spawning_popenr�rr��RebuildProxyr�r�r�r)r%r7rrrr�s

zBaseProxy.__reduce__cCs
|j�S)N)r�)r%�memorrr�__deepcopy__"szBaseProxy.__deepcopy__cCs&dt|�j|jjt|�fS)Nz<%s object, typeid %r at %#x>)rr+r�r"r$)r%rrrr,%szBaseProxy.__repr__cCsBy|jd�SWn*tk
r=t|�dd�dSYnXdS)zV
        Return representation of the referent (or a fall-back if that fails)
        r,Nrz; '__str__()' failed>r�)r�rr�)r%rrrrB)s
zBaseProxy.__str__)r+r-r.r/r�rZForkAwareThreadLockr�r&r�r�r�r�r�r�r�r�r�r,rBrrrrr�s"	
cCs�ttj�dd�}|rB|j|jkrB|j|jdS|jdd�ojttj�dd�}|||d||�SdS)z�
    Function used for unpickling proxy objects.

    If possible the shared object is returned, or otherwise a proxy for it.
    rjNrrSTZ_inheritingF)rrrir#r^r$�pop)rGr�rcr7r�rSrrrr�6sr�c
Cs�t|�}y|||fSWntk
r2YnXi}x%|D]}td||f|�q@Wt|tf|�}||_||||f<|S)zB
    Return a proxy type whose methods are given by `exposed`
    zLdef %s(self, *args, **kwds):
        return self._callmethod(%r, args, kwds))r�r��execrrr�)rr��_cacheZdic�meth�	ProxyTyperrr�
MakeProxyTypeKs

	r�Tc
Cs�t|d}|dkrY||jd|�}zt|dd|f�}Wd|j�X|dkrz|dk	rz|j}|dkr�tj�j}td|j	|�}|||d|d|d|�}	d|	_
|	S)	z*
    Return an auto-proxy for `token`
    rNr[rOz
AutoProxy[%s]r�rST)r\r#r:r�r�rrir[r�r"r�)
r�rcr�r[r�rSr�r�r�r�rrrr�as			r�c@s(eZdZdd�Zdd�ZdS)�	NamespacecKs|jj|�dS)N)r��update)r%r7rrrr&szNamespace.__init__cCst|jj��}g}x:|D]2\}}|jd�s"|jd||f�q"W|j�d|jjdj|�fS)NrIz%s=%rz%s(%s)z, )	rr�r�
startswithrEr�r*r+r�)r%rrFrr�rrrr,�s
zNamespace.__repr__N)r+r-r.r&r,rrrrr�~sr�c@sReZdZddd�Zdd�Zdd�Zdd	�Zeee�Zd
S)�ValueTcCs||_||_dS)N)�	_typecode�_value)r%rr��lockrrrr&�s	zValue.__init__cCs|jS)N)r)r%rrrr��sz	Value.getcCs
||_dS)N)r)r%r�rrrr��sz	Value.setcCs dt|�j|j|jfS)Nz
%s(%r, %r))rr+rr)r%rrrr,�szValue.__repr__N)	r+r-r.r&r�r�r,r�r�rrrrr�s
rcCstj||�S)N)r)rZsequencerrrr�Array�src@sReZdZdZdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�
IteratorProxy�__next__r1�throwr�cCs|S)Nr)r%rrr�__iter__�szIteratorProxy.__iter__cGs|jd|�S)Nr)r�)r%r6rrrr�szIteratorProxy.__next__cGs|jd|�S)Nr1)r�)r%r6rrrr1�szIteratorProxy.sendcGs|jd|�S)Nr)r�)r%r6rrrr�szIteratorProxy.throwcGs|jd|�S)Nr�)r�)r%r6rrrr��szIteratorProxy.closeN)rr1rr�)	r+r-r.r�r	rr1rr�rrrrr�src@sLeZdZd
Zdddd�Zdd�Zd	d
�Zdd�ZdS)�
AcquirerProxy�acquire�releaseTNcCs1|dkr|fn	||f}|jd|�S)Nr)r�)r%Zblockingr�r6rrrr�s!zAcquirerProxy.acquirecCs
|jd�S)Nr)r�)r%rrrr�szAcquirerProxy.releasecCs
|jd�S)Nr)r�)r%rrrr��szAcquirerProxy.__enter__cCs
|jd�S)Nr)r�)r%r�r�r�rrrr��szAcquirerProxy.__exit__)rr)r+r-r.r�rrr�r�rrrrr
�s
r
c@sLeZdZdZddd�Zd	d
�Zdd�Zdd
d�ZdS)�ConditionProxyrrrp�notify�
notify_allNcCs|jd|f�S)Nrp)r�)r%r�rrrrp�szConditionProxy.waitcCs
|jd�S)Nr)r�)r%rrrr�szConditionProxy.notifycCs
|jd�S)Nr)r�)r%rrrr�szConditionProxy.notify_allcCs�|�}|r|S|dk	r/t�|}nd}d}xF|s�|dk	rj|t�}|dkrjP|j|�|�}q>W|S)Nr)�_timerp)r%Z	predicater�r9ZendtimeZwaittimerrr�wait_for�s		


zConditionProxy.wait_for)rrrprr)r+r-r.r�rprrrrrrrr
�s
r
c@sIeZdZdZdd�Zdd�Zd	d
�Zddd
�ZdS)�
EventProxyror�r�rpcCs
|jd�S)Nro)r�)r%rrrro�szEventProxy.is_setcCs
|jd�S)Nr�)r�)r%rrrr��szEventProxy.setcCs
|jd�S)Nr�)r�)r%rrrr��szEventProxy.clearNcCs|jd|f�S)Nrp)r�)r%r�rrrrp�szEventProxy.wait)ror�r�rp)r+r-r.r�ror�r�rprrrrr�s
rc@sseZdZdZddd�Zdd	�Zd
d�Zedd
��Zedd��Z	edd��Z
dS)�BarrierProxy�__getattribute__rp�abort�resetNcCs|jd|f�S)Nrp)r�)r%r�rrrrp�szBarrierProxy.waitcCs
|jd�S)Nr)r�)r%rrrr�szBarrierProxy.abortcCs
|jd�S)Nr)r�)r%rrrr�szBarrierProxy.resetcCs|jdd�S)Nr�parties)r)r�)r%rrrr�szBarrierProxy.partiescCs|jdd�S)Nr�	n_waiting)r)r�)r%rrrr�szBarrierProxy.n_waitingcCs|jdd�S)Nr�broken)r)r�)r%rrrr�szBarrierProxy.broken)rrprr)r+r-r.r�rprrr�rrrrrrrr�src@s:eZdZdZdd�Zdd�Zdd	�Zd
S)�NamespaceProxyr�__setattr__�__delattr__cCsB|ddkr tj||�Stj|d�}|d|f�S)NrrIr�r)�objectr)r%r��
callmethodrrr�__getattr__�szNamespaceProxy.__getattr__cCsH|ddkr#tj|||�Stj|d�}|d||f�S)NrrIr�r)rrr)r%r�r�rrrrr�szNamespaceProxy.__setattr__cCsB|ddkr tj||�Stj|d�}|d|f�S)NrrIr�r)rrr)r%r�rrrrr�szNamespaceProxy.__delattr__N)rrr)r+r-r.r�rrrrrrrr�src@s=eZdZdZdd�Zdd�Zeee�ZdS)	�
ValueProxyr�r�cCs
|jd�S)Nr�)r�)r%rrrr�szValueProxy.getcCs|jd|f�S)Nr�)r�)r%r�rrrr�	szValueProxy.setN)r�r�)r+r-r.r�r�r�r�r�rrrrr sr �
BaseListProxy�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rE�count�extend�index�insertr��remove�reverser��__imul__c@s(eZdZdd�Zdd�ZdS)�	ListProxycCs|jd|f�|S)Nr,)r�)r%r�rrr�__iadd__szListProxy.__iadd__cCs|jd|f�|S)Nr1)r�)r%r�rrrr1szListProxy.__imul__N)r+r-r.r3r1rrrrr2sr2�	DictProxyr�r�r�Zhas_key�popitem�
setdefaultr��
ArrayProxy�	PoolProxyZapplyZapply_asyncr�ZimapZimap_unorderedr��mapZ	map_async�starmapZ
starmap_asyncr�ZAsyncResult�Iteratorc@s(eZdZdd�Zdd�ZdS)r8cCs|S)Nr)r%rrrr�5szPoolProxy.__enter__cCs|j�dS)N)r�)r%r�r�r�rrrr�7szPoolProxy.__exit__N)r+r-r.r�r�rrrrr84sc@seZdZdZdS)ra(
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    N)r+r-r.r/rrrrr>s	�QueueZ
JoinableQueuerg�Lockra�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolrr�r�r�F)I�__all__rsr`rZqueuerrr�r�r	r
rrr
rrrr�Z
view_typesrr!Z	view_typerrr:r3rr=rHrJrKr�rdreZXmlListenerZ	XmlClientr\rr�r�rr�r�r�r�rrrr
r
rrrr r!r2r4r7Z
BasePoolProxyr�r8rr<rgr=rar>r?r@rArBr�rrrr�<module>s�


��
�
		


?>