Your IP : 3.141.198.113


Current Path : /opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/managers.cpython-34.pyo

�
e f���@s�ddddgZddlZddlZddlZddlZddlmZddlmZdd	l	m
Z
dd
l	mZddl	mZddl	m
Z
dd
l	mZddl	mZddl	mZdd�Zejeje�dd�dddfD�Zedek	rMdd�ZxeD]Zejee�q0WnGdd�de�Zfidd�Zdd�ZGdd�de�Zd d!�Zd"d#�ZGd$d%�d%e�ZGd&d'�d'e�Z ie
j!e
j"fd(6e
j#e
j$fd)6Z%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;idtdj6dtdp6dtdr6dudl6dudm6e;_<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/python34/lib64/python3.4/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__cCsd|j|j|jfS)Nz#Token(typeid=%r, address=%r, id=%r))r"r#r$)r%rrr�__repr__CszToken.__repr__N)ztypeidzaddresszid)	�__name__�
__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
r9cCsN|dkr|S|dkr&t|�S|dkr@td|�Std�SdS)Nz#ERRORz
#TRACEBACKz#UNSERIALIZABLEzUnserializable message: %s
zUnrecognized message type)�RemoteError�
ValueError)r7r8rrrr2Us
r2c@seZdZdd�ZdS)r:cCs)ddddt|jd�ddS)N�
�-�Kr)�strr5)r%rrr�__str__bszRemoteError.__str__N)r+r,r-r@rrrrr:asr:cCsLg}x?t|�D]1}t||�}t|�r|j|�qqW|S)z4
    Return a list of names of methods of `obj`
    )�dirr�callable�append)r �tempr�funcrrr�all_methodsisrFcCsdd�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>)rF)r rrr�public_methodstsrHc	@seZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zied6ed6e
d6Z
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�||_tj|�|_t|\}}|d|dd�|_|jj|_idffd6|_i|_t	j
�|_dS)Nr#Zbacklog��0)�registryr�AuthenticationString�authkey�listener_client�listenerr#�	id_to_obj�id_to_refcount�	threading�RLock�mutex)r%rUr#rW�
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_ntjd�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%rhrrr�
serve_forever�s 	
	
zServer.serve_foreverc
Csgx`y|jj�}Wntk
r-wYnXtjd|jd|f�}d|_|j�qWdS)Nrbr5T)rYZaccept�OSErrorr\rg�handle_requestrirj)r%r3�trrrrh�s
	zServer.accepterc'Csud}}}yWtj||j�tj||j�|j�}|\}}}}t||�}Wn!tk
r�dt�f}	YnGXy||||�}Wn!tk
r�dt�f}	Yn
Xd|f}	y|j|	�Wn�tk
rf}
zdy|jdt�f�Wntk
r#YnXt	j
d|	�t	j
d|�t	j
d|
�WYdd}
~
XnX|j�dS)z)
        Handle a new connection
        Nz
#TRACEBACKz#RETURNzFailure to send message: %rz ... request was %rz ... exception was %r)r	Zdeliver_challengerWZanswer_challenger1r�	Exceptionrr0r�info�close)r%r3Zfuncnamer8�request�ignorer5r6rE�msg�errrrx�s2


#zServer.handle_requestc*Cs+tjdtj�j�|j}|j}|j}x�|jj	�s&y/d}}|�}|\}}}	}
||\}}}||kr�t
d|t|�|f��nt||�}
y|
|	|
�}Wn1t
k
r}zd|f}WYdd}~XnpX|o|j|d�}|rh|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
r:tjdtj�j�tjd	�Yn!t
k
rZdt�f}YnXyPy||�Wn;t
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)rrrr\�current_threadrr1r0rZrdrk�AttributeErrorrrrz�getrKrr#r�fallback_mapping�EOFErrorroru�reprr{r|)r%�connr1r0rZr4r r}�identr5r6�exposedZ	gettypeidZfunction�resr�rr"ZridentZrexposed�tokenZ
fallback_funcr8rrr�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)r�)r%r�r�r rrr�
fallback_repr%szServer.fallback_reprr@r*z	#GETVALUEcCsdS)Nr)r%r3rrrrP.szServer.dummycCs�|jj�z�g}t|jj��}|j�xY|D]Q}|dkr<|jd||j|t|j|d�dd�f�q<q<Wdj	|�SWd|jj
�XdS)zO
        Return some info --- useful to spot problems with refcounting
        rTz  %s:       refcount=%s
    %srNr>r<)r^�acquirerrZr�sortrCr[r?�join�release)r%r3r8rr�rrrrN1s


	
-zServer.debug_infocCst|j�dS)z*
        Number of shared objects
        r)�lenrZ)r%r3rrrrOCszServer.number_of_objectscCsXzCytjd�|jd�Wnddl}|j�YnXWd|jj�XdS)z'
        Shutdown this process
        z!manager received shutdown message�#RETURNNr)r�N)rrrr0�	traceback�	print_excrd�set)r%r3r�rrrrJIs
zServer.shutdownc
Os%|jj�z|j|\}}}}|dkrB|d}	n|||�}	|dkrlt|	�}n|dk	r�t|�t|�}ndt|	�}
tjd||
�|	t|�|f|j	|
<|
|j
kr�d|j
|
<n|j||
�|
t|�fSWd|jj
�XdS)z>
        Create a new shared object and return its id
        Nrz%xz&%r callable returned object with id %r)r^r�rUrHrr$rrrr�rZr[rQ�tupler�)r%r3r"r5r6rBr��method_to_typeid�	proxytyper r�rrrrKVs$

z
Server.createcCst|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r)r�rZr$)r%r3r�rrrrM|szServer.get_methodscCs-|tj�_|jd�|j|�dS)z=
        Spawn a new thread to serve this connection
        �#RETURNN)r�N)r\r�rr0r�)r%r3rrrrrL�s
zServer.accept_connectionc
Cs7|jj�z|j|d7<Wd|jj�XdS)Nr)r^r�r[r�)r%r3r�rrrrQ�s
z
Server.increfc
Csq|jj�zO|j|d8<|j|dkr[|j|=|j|=tjd|�nWd|jj�XdS)Nrrzdisposing of obj with id %r)r^r�r[rZrrrr�)r%r3r�rrrrR�s
z
Server.decrefN)r+r,r-r.Zpublicr&rvrhrxr�r�r�r�r�rPrNrOrJrKrMrLrQrRrrrrrI~s0
"J

&rIc@s+eZdZdgZdZdZdZdS)�State�valuerr�N)r+r,r-r/�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}n||_tj|�|_t�|_tj|j_	||_
t|\|_|_
|pt�|_dS)N)rrerW�_addressrV�_authkeyr��_stater�r��_serializerrXZ	_Listener�_Clientr�_ctx)r%r#rWr_Zctxrrrr&�s		zBaseManager.__init__cCst|j|j|j|j�S)zX
        Return server object with serve_forever() method and address attribute
        )rI�	_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
        rWNrP)	rXr�r�r�r9r�r�r�r�)r%r`rar�rrr�connect�szBaseManager.connectcCsR|dk	r(t|�r(td��ntjdd�\}}|jjdt|�jd|j|j	|j
|j|||f�|_dj
dd	�|jjD��}t|�jd
||j_|jj�|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 callableZduplexFrbr5�:css|]}t|�VqdS)N)r?)r�irrr�	<genexpr>�sz$BaseManager.start.<locals>.<genexpr>r=�exitpriorityr)rB�	TypeErrorr	ZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr+rrjr|r1r�r�r�r�r�Finalize�_finalize_managerr�rJ)r%�initializer�initargs�reader�writerr�rrrrj�s&"


zBaseManager.startc	Csl|dk	r||�n|j||||�}|j|j�|j�tjd|j�|j�dS)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)�_Serverr0r#r|rr{rv)	�clsrUr#rWr_r�r�r��serverrrrr��s

zBaseManager._run_servercOsk|j|jd|j�}z)t|dd|f||�\}}Wd|j�Xt||j|�|fS)zP
        Create a new shared object; return the token and exposed tuple
        rWNrK)r�r�r�r9r|r)r%r"r5r6r�r$r�rrr�_creates
)zBaseManager._createcCsA|jdk	r=|jj|�|jj�s=d|_q=ndS)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
        rWNrN)r�r�r�r9r|)r%r�rrr�_debug_info$szBaseManager._debug_infoc
CsA|j|jd|j�}zt|dd�SWd|j�XdS)z5
        Return the number of shared objects
        rWNrO)r�r�r�r9r|)r%r�rrr�_number_of_objects.szBaseManager._number_of_objectscCs&|jjtjkr"|j�n|S)N)r�r�r�r�rj)r%rrr�	__enter__8s
zBaseManager.__enter__cCs|j�dS)N)rJ)r%�exc_type�exc_val�exc_tbrrr�__exit__>szBaseManager.__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�q�q�q�nt	j
|_ytj
|=Wntk
rYnXdS)zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to managerrWNrJr�g�?zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�rr{r9r|rzr��hasattrr�r�r�r�r�_address_to_local�KeyError)rr#rWr(r�r�rrrr�As.





zBaseManager._finalize_managercCs|jS)N)r�)r%rrr�<lambda>aszBaseManager.<lambda>Tc
s�d|jkr$|jj�|_n�dkr9t�n|pNt�dd�}|pft�dd�}|r�x#t|j��D]\}}q�Wn|||�f|j�<|r���fdd�}	�|	_t|�|	�ndS)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_c	s�tjd��|j�||�\}}�||jd|d|jd|�}|j|jd|j�}t|dd|jf�|S)Nz)requesting creation of a shared %r object�managerrWr�rR)	rrrr�r�r�r�r#r9r$)r%r5r6r�Zexp�proxyr�)r�r"rrrD~sz"BaseManager.register.<locals>.temp)	�__dict__r��copy�	AutoProxyrrrr+�setattr)
r�r"rBr�r�r��
create_method�keyr�rDr)r�r"r�registercs	
	zBaseManager.register)r+r,r-r.r�rIr�r&r�r�rj�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
    NTcCsAtjj�zPtjj|jd�}|dkr\tj�t�f}|tj|j<nWdtjj	�X|d|_
|d|_||_|jj
|_||_||_t|d|_|dk	r�tj|�|_n3|jdk	r|jj|_ntj�j|_|r*|j�ntj|tj�dS)Nrr)r�_mutexr�r�r�r#rZForkAwareLocalr�r��_tls�_idset�_tokenr$�_id�_managerr�rXr�rrVr�rerW�_increfr��_after_fork)r%r�r_r�rWr�rQZ	tls_idsetrrrr&�s,


			
zBaseProxy.__init__cCs�tjd�tj�j}tj�jdkrK|dtj�j7}n|j|jj	d|j
�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|rWrL)rrrrrerr\r�r�r�r#r�r9r�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�rWr�NrR���)r�r	r�rrrr\r�rr�r0r�r1r�r�r"r�r#r�r�r�r9r$r2)r%r4r5r6r�r7r8r�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)NrWrQz	INCREF %rr5r��
)r�r�r#r�r9r�rrrr$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�|`ndS)Nz	DECREF %rrWrRz... decref failed %sz%DECREF %r -- manager already shutdownr	z-thread %r has no more proxies so closing conn)�discardr$r�r�r�rrrr#r9rzr�r\r�rr	r|)r�rWr(ZtlsZidsetr�r�r�rrrr�s&	
zBaseProxy._decrefcCsTd|_y|j�Wn6tk
rO}ztjd|�WYdd}~XnXdS)Nzincref failed: %s)r�r�rzrr{)r%r�rrrr�s
	zBaseProxy._after_forkcCs�i}tj�dk	r(|j|d<nt|dd�rc|j|d<tt|j|j|ffStt	|�|j|j|ffSdS)NrW�_isautoFr�)
r
Zget_spawning_popenr�rr��RebuildProxyr�r�r�r)r%r6rrrr�$s
zBaseProxy.__reduce__cCs
|j�S)N)r�)r%�memorrr�__deepcopy__1szBaseProxy.__deepcopy__cCs*dt|�j|jjdt|�fS)Nz<%s object, typeid %r at %s>z0x%x)rr+r�r"r$)r%rrrr*4szBaseProxy.__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�rzr�)r%rrrr@8s
zBaseProxy.__str__)r+r,r-r.r�rZForkAwareThreadLockr�r&r�r�r�r�r�r�r�r�r�r*r@rrrrr�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.
    rfNrrQTZ_inheritingF)rrrer#rZr$�pop)rEr�r_r6r�rQrrrr�Esr�c
Cs�t|�}y|||fSWntk
r2YnXi}x%|D]}td||f|�q@Wt|tf|�}||_||||f<|S)zC
    Return an 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�
MakeProxyTypeZs

	r�Tc
Cs�t|d}|dkr\||jd|�}zt|dd|f�}Wd|j�Xn|dkr�|dk	r�|j}n|dkr�tj�j}ntd|j	|�}|||d|d|d|�}	d|	_
|	S)	z*
    Return an auto-proxy for `token`
    rNrWrMz
AutoProxy[%s]r�rQT)rXr#r9r|r�rrerWr�r"r�)
r�r_r�rWr�rQr�r�r�r�rrrr�ps		r�c@s(eZdZdd�Zdd�ZdS)�	NamespacecKs|jj|�dS)N)r��update)r%r6rrrr&�szNamespace.__init__cCsyt|jj��}g}x=|D]5\}}|jd�s"|jd||f�q"q"W|j�dtjd|�S)NrGz%s=%rz
Namespace(%s)z, )rr�r�
startswithrCr�r?r�)r%rrDrr�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+r�r�)r%rrrr*�szValue.__repr__N)	r+r,r-r&r�r�r*r�r�rrrrr��s
r�cCstj||�S)N)r)rZsequencer�rrr�Array�src@sReZdZdZdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�
IteratorProxy�__next__r0�throwr|cCs|S)Nr)r%rrr�__iter__�szIteratorProxy.__iter__cGs|jd|�S)Nr)r�)r%r5rrrr�szIteratorProxy.__next__cGs|jd|�S)Nr0)r�)r%r5rrrr0�szIteratorProxy.sendcGs|jd|�S)Nr)r�)r%r5rrrr�szIteratorProxy.throwcGs|jd|�S)Nr|)r�)r%r5rrrr|�szIteratorProxy.closeN)z__next__zsendzthrowzclose)	r+r,r-r�rrr0rr|rrrrr�src@sLeZdZd
Zdddd�Zdd�Zd	d
�Zdd�ZdS)�
AcquirerProxyr�r�TNcCs1|dkr|fn	||f}|jd|�S)Nr�)r�)r%Zblockingr�r5rrrr��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__)zacquirezrelease)r+r,r-r�r�r�r�r�rrrrr�s
rc@sLeZdZdZddd�Zd	d
�Zdd�Zdd
d�ZdS)�ConditionProxyr�r�rl�notify�
notify_allNcCs|jd|f�S)Nrl)r�)r%r�rrrrl�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}xL|s�|dk	rp|t�}|dkrpPqpn|j|�|�}q>W|S)Nr)�_timerl)r%Z	predicater�r8ZendtimeZwaittimerrr�wait_for�s		


zConditionProxy.wait_for)zacquirezreleasezwaitznotifyz
notify_all)r+r,r-r�rlrrr
rrrrr�s
rc@sIeZdZdZdd�Zdd�Zd	d
�Zddd
�ZdS)�
EventProxyrkr�r�rlcCs
|jd�S)Nrk)r�)r%rrrrk�szEventProxy.is_setcCs
|jd�S)Nr�)r�)r%rrrr��szEventProxy.setcCs
|jd�S)Nr�)r�)r%rrrr��szEventProxy.clearNcCs|jd|f�S)Nrl)r�)r%r�rrrrl�szEventProxy.wait)zis_setzsetzclearzwait)r+r,r-r�rkr�r�rlrrrrr�s
rc@sseZdZdZddd�Zdd	�Zd
d�Zedd
��Zedd��Z	edd��Z
dS)�BarrierProxy�__getattribute__rl�abort�resetNcCs|jd|f�S)Nrl)r�)r%r�rrrrl�szBarrierProxy.waitcCs
|jd�S)Nr)r�)r%rrrr�szBarrierProxy.abortcCs
|jd�S)Nr)r�)r%rrrr�szBarrierProxy.resetcCs|jdd�S)Nr
�parties)zparties)r�)r%rrrr�szBarrierProxy.partiescCs|jdd�S)Nr
�	n_waiting)z	n_waiting)r�)r%rrrr�szBarrierProxy.n_waitingcCs|jdd�S)Nr
�broken)zbroken)r�)r%rrrr�szBarrierProxy.broken)z__getattribute__zwaitzabortzreset)r+r,r-r�rlrrr�rrrrrrrr�src@s:eZdZdZdd�Zdd�Zdd	�Zd
S)�NamespaceProxyr
�__setattr__�__delattr__cCsB|ddkr tj||�Stj|d�}|d|f�S)NrrGr�r
)�objectr
)r%r��
callmethodrrr�__getattr__szNamespaceProxy.__getattr__cCsH|ddkr#tj|||�Stj|d�}|d||f�S)NrrGr�r)rrr
)r%r�r�rrrrrszNamespaceProxy.__setattr__cCsB|ddkr tj||�Stj|d�}|d|f�S)NrrGr�r)rrr
)r%r�rrrrr
szNamespaceProxy.__delattr__N)z__getattribute__z__setattr__z__delattr__)r+r,r-r�rrrrrrrrs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)zgetzset)r+r,r-r�r�r�r�r�rrrrrsr�
BaseListProxy�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rC�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)Nr*)r�)r%r�rrrr*'szListProxy.__imul__N)r+r,r-r,r*rrrrr+#sr+�	DictProxyr�r�r�Zhas_key�popitem�
setdefaultr��
ArrayProxy�	PoolProxyZapplyZapply_asyncr|ZimapZimap_unorderedr��mapZ	map_async�starmapZ
starmap_asyncr�ZAsyncResult�Iteratorc@s(eZdZdd�Zdd�ZdS)r1cCs|S)Nr)r%rrrr�DszPoolProxy.__enter__cCs|j�dS)N)r�)r%r�r�r�rrrr�FszPoolProxy.__exit__N)r+r,r-r�r�rrrrr1Cs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.rrrrrMs	�QueueZ
JoinableQueuerc�Lockr]�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolr�dictr�r�F)I�__all__ror\rZqueuerr	r�r�r	r
rrr
rrrr�Z
view_typesrr!Z	view_typerrr9r2rzr:rFrHrIr�r`raZXmlListenerZ	XmlClientrXrr�r�rr�r�r�r�r�rrrrrrrrrr+r-r0Z
BasePoolProxyr�r1rr5rcr6r]r7r8r9r:r;r<rrrr�<module>s�


�#
�
�
		



?>