3 \@sddddgZddlZddlZddlZddlZddlZddlmZddlm Z dd l m Z m Z dd lm Z dd lmZdd lmZdd lmZddZe jejedddDZedek rddZxeD]Ze jeeqWGdddeZfifddZddZGdddeZddZd d!ZGd"d#d#eZGd$d%d%eZ e j!e j"fe j#e j$fd&Z%Gd'ddeZ&Gd(d)d)e'Z(Gd*ddeZ)d+d,Z*ifd-d.Z+dd0d1Z,Gd2d3d3eZ-Gd4d5d5eZ.dd6d7Z/Gd8d9d9e)Z0Gd:d;d;e)Z1Gdd?d?e)Z3Gd@dAdAe)Z4GdBdCdCe)Z5GdDdEdEe)Z6e+dFdZ7GdZd[d[e7Z8e+d\dZ9d]deie9_:e+dfdZ;e+dgdZe>jdwej?e>jdxej?e>jdyej@e3e>jdzejAe1e>jd{ejBe1e>jd|ejCe1e>jd}ejDe1e>jd~ejEe2e>jdejFe4e>jde jGe=e>jdee8e>jdeHe9e>jd5e.e6e>jd7e/e;e>jd3e-e5e>jdee0dde>jdsdddS) BaseManager SyncManager BaseProxyTokenN) format_exc) connection) reductionget_spawning_popen)pool)process)util) get_contextcCstj|j|jffS)N)arraytypecodetobytes)ar0/usr/lib64/python3.6/multiprocessing/managers.py reduce_array$srcCsg|]}tti|qSr)typegetattr).0namerrr (sritemskeysvaluescCstt|ffS)N)list)objrrrrebuild_as_list*sr c@s4eZdZdZdZddZddZd d Zd d Zd S)rz4 Type to uniquely indentify a shared object typeidaddressidcCs||||_|_|_dS)N)r!r"r#)selfr!r"r#rrr__init__9szToken.__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|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r)) __class____name__r!r"r#)r$rrr__repr__BszToken.__repr__N)r!r"r#) r* __module__ __qualname____doc__ __slots__r%r&r(r+rrrrr3s cCs8|j||||f|j\}}|dkr*|St||dS)zL Send a message to manager using connection `c` and return response z#RETURNN)sendrecvconvert_to_error)cr# methodnameargskwdskindresultrrrdispatchJs  r9cCs\|dkr |S|dkr,t|tks$tt|S|dkrPt|tksDttd|StdSdS)Nz#ERRORz #TRACEBACKz#UNSERIALIZABLEzUnserializable message: %s zUnrecognized message type)rstrAssertionError RemoteError ValueError)r7r8rrrr2Ts r2c@seZdZddZdS)r<cCs&ddddt|jdddS)N -Kr)r:r5)r$rrr__str__aszRemoteError.__str__N)r*r,r-rArrrrr<`sr<cCs6g}x,t|D] }t||}t|r|j|qW|S)z4 Return a list of names of methods of `obj` )dirrcallableappend)rtemprfuncrrr all_methodshs  rGcCsddt|DS)zP Return a list of names of methods of `obj` which do not start with '_' cSsg|]}|ddkr|qS)r_r)rrrrrrwsz"public_methods..)rG)rrrrpublic_methodsssrIc @seZdZdZdddddddd d g Zd d Zd dZddZddZddZ ddZ ddZ ddZ e e e dZ ddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.S)/ServerzM Server class which runs in a process controlled by a manager object shutdowncreateaccept_connection get_methods debug_infonumber_of_objectsdummyincrefdecrefcCslt|tst||_tj||_t|\}}||dd|_|jj |_ ddffi|_ i|_ i|_ t j|_dS)N)r"Zbacklog0) isinstancebytesr;registryr AuthenticationStringauthkeylistener_clientlistenerr" id_to_objid_to_refcountid_to_local_proxy_obj threadingLockmutex)r$rXr"rZ serializerListenerClientrrrr%s   zServer.__init__cCstj|_|tj_zZtj|jd}d|_|j y x|jj sN|jj dq6WWnt t fk rjYnXWdtjtjkrtjdtjt_tjt_tjdXdS)z( Run the server forever )targetTrNzresetting stdout, stderrr)r`Event stop_eventr current_process_manager_serverThreadaccepterdaemonstartis_setwaitKeyboardInterrupt SystemExitsysstdout __stdout__r debug __stderr__stderrexit)r$rlrrr serve_forevers       zServer.serve_foreverc CsPxJy|jj}Wntk r&wYnXtj|j|fd}d|_|jqWdS)N)rfr5T)r\ZacceptOSErrorr`rkhandle_requestrmrn)r$r3trrrrlszServer.accepterc 'CsLd}}}yTtj||jtj||j|j}|\}}}}||jksTtd|t||}Wntk r~dt f} Yn>Xy||f||}Wntk rdt f} Yn Xd|f} y|j | Wnttk r>} zVy|j dt fWntk rYnXt j d| t j d|t j 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)rZdeliver_challengerZZanswer_challenger1publicr;r Exceptionrr0r infoclose) r$r3funcnamer8requestignorer5r6rFmsgerrrr|s4    zServer.handle_requestcDCstjdtjj|j}|j}|j}x|jj syBd}}|}|\}}} } y||\}} } Wn^t k r} zBy|j |\}} } Wn&t k r}z | WYdd}~XnXWYdd} ~ XnX|| krt d|t || ft||}y|| | }Wn,tk r&}zd|f}WYdd}~XnPX| o8| j|d}|rn|j|||\}}t||j|}d||ff}nd|f}Wnt k r|dkrdtf}nNy,|j|}|||||f| | }d|f}Wn tk rdtf}YnXYnPtk r"tjdtjjtjd Yn tk r@dtf}YnXyDy ||Wn2tk r}z|d tfWYdd}~XnXWq(tk r}zBtjd tjjtjd |tjd ||jtjdWYdd}~Xq(Xq(WdS)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)r rvr`current_threadrr1r0r]rhroKeyErrorr_AttributeErrorrrrgetrLrr"rfallback_mappingEOFErrorrsryrr)r$connr1r0r]r4rridentr5r6exposed gettypeidkeZ second_keZfunctionresrrr!ZridentZrexposedtokenZ fallback_funcr8rrr serve_clientsx  (        $   zServer.serve_clientcCs|S)Nr)r$rrrrrrfallback_getvalue&szServer.fallback_getvaluecCst|S)N)r:)r$rrrrrr fallback_str)szServer.fallback_strcCst|S)N)repr)r$rrrrrr fallback_repr,szServer.fallback_repr)rAr+z #GETVALUEcCsdS)Nr)r$r3rrrrQ5sz Server.dummycCs||jlg}t|jj}|jxD|D]<}|dkr(|jd||j|t|j|dddfq(Wdj|SQRXdS)zO Return some info --- useful to spot problems with refcounting rUz %s: refcount=%s %srNr@r>) rbrr^rsortrDr:r]join)r$r3r8rrrrrrO8s  $zServer.debug_infocCs t|jS)z* Number of shared objects )lenr^)r$r3rrrrPGszServer.number_of_objectscCsLz:ytjd|jdWnddl}|jYnXWd|jjXdS)z' Shutdown this process z!manager received shutdown message#RETURNNr)rN)r rvr0 traceback print_excrhset)r$r3rrrrrKNs zServer.shutdownc Os|j|j|\}}}}|dkrBt|dkr4| s8t|d} n |||} |dkr\t| }|dk rt|tksttt|t|}dt| } t j d|| | t ||f|j | <| |j krd|j | <WdQRX|j|| | t|fS)z> Create a new shared object and return its id Nrrz%xz&%r callable returned object with id %r)rbrXrr;rIrdictrr#r rvrr]r^rRtuple) r$r3r!r5r6rCrmethod_to_typeid proxytyperrrrrrL[s$     z Server.createcCst|j|jdS)zL Return the methods of the shared object indicated by token r)rr]r#)r$r3rrrrrNzszServer.get_methodscCs"|tj_|jd|j|dS)z= Spawn a new thread to serve this connection #RETURNN)rN)r`rrr0r)r$r3rrrrrMs  zServer.accept_connectioncCs|jy|j|d7<Wnhtk r}zL||jkrrd|j|<|j||j|<|j|\}}}tjd|n|WYdd}~XnXWdQRXdS)Nrz&Server re-enabled tracking & INCREF %r)rbr^rr_r]r rv)r$r3rrrrrrrrrRs  z Server.increfcCs||jkr$||jkr$tjd|dS|j@|j|dks>t|j|d8<|j|dkrf|j|=WdQRX||jkrdfdf|j|<tjd||j|j|=WdQRXdS)NzServer DECREF skipping %rrrzdisposing of obj with id %r)r^r_r rvrbr;r])r$r3rrrrrSs     z Server.decrefN)r*r,r-r.r~r%rzrlr|rrrrrrQrOrPrKrLrNrMrRrSrrrrrJ}s. "Q rJc@seZdZdgZdZdZdZdS)StatevaluerrN)r*r,r-r/INITIALSTARTEDSHUTDOWNrrrrrsr)pickleZ xmlrpclibc@seZdZdZiZeZd!ddZddZdd Z dffd d Z e dffd d Z ddZ d"ddZddZddZddZddZeddZeddZe d#dd ZdS)$rz! Base class for managers NrcCs\|dkrtjj}||_tj||_t|_tj|j_ ||_ t |\|_ |_ |pTt|_dS)N)r rirZ_addressrY_authkeyr_staterr _serializerr[Z _Listener_Clientr_ctx)r$r"rZrcZctxrrrr%s   zBaseManager.__init__cCs(|jjtjkstt|j|j|j|j S)zX Return server object with serve_forever() method and address attribute ) rrrrr;rJ _registryrrr)r$rrr get_servers zBaseManager.get_servercCs8t|j\}}||j|jd}t|ddtj|j_dS)z> Connect manager object to the server process )rZNrQ) r[rrrr9rrrr)r$rdrerrrrconnects zBaseManager.connectc Cs|jjtjkst|dk r,t| r,tdtjdd\}}|j j t |j |j |j|j|j|||fd|_djdd|jjD}t |jd ||j_|jj|j|j|_|jtj|j_tj|t |j|j|j|j|j|jfd d |_dS) z@ Spawn a server process for this manager object Nzinitializer must be a callableF)Zduplex)rfr5:css|]}t|VqdS)N)r:)rirrr sz$BaseManager.start..r?r)r5 exitpriority)rrrrr;rC TypeErrorrZPiperZProcessr _run_serverrrrr_processrZ _identityr*rrnrr1rr Finalize_finalize_managerrrK)r$ initializerinitargsreaderwriterrrrrrns(       zBaseManager.startc CsN|dk r|||j||||}|j|j|jtjd|j|jdS)z@ Create a server, report its address and run it Nzmanager serving at %r)_Serverr0r"rr rrz) clsrXr"rZrcrrrserverrrrrs zBaseManager._run_serverc Osd|jjtjkstd|j|j|jd}zt|dd|f||\}}Wd|j Xt ||j||fS)zP Create a new shared object; return the token and exposed tuple zserver not yet started)rZNrL) rrrrr;rrrr9rr)r$r!r5r6rr#rrrr_create%s  zBaseManager._createcCs*|jdk r&|jj||jjs&d|_dS)zC Join the manager process (if it has been spawned) N)rris_alive)r$timeoutrrrr1s   zBaseManager.joinc Cs.|j|j|jd}z t|ddS|jXdS)zS Return some info about the servers shared objects and connections )rZNrO)rrrr9r)r$rrrr _debug_info:s zBaseManager._debug_infoc Cs.|j|j|jd}z t|ddS|jXdS)z5 Return the number of shared objects )rZNrP)rrrr9r)r$rrrr_number_of_objectsDs zBaseManager._number_of_objectscCs,|jjtjkr|j|jjtjks(t|S)N)rrrrrnrr;)r$rrr __enter__NszBaseManager.__enter__cCs |jdS)N)rK)r$exc_typeexc_valexc_tbrrr__exit__TszBaseManager.__exit__cCs|jrtjdy,|||d}zt|ddWd|jXWntk rRYnX|jdd|jrtjdt|drtjd |j|jd d|jrtjd t j |_ y t j |=Wntk rYnXdS) zQ Shutdown the manager process; will be registered as a finalizer z#sending shutdown message to manager)rZNrKg?)rzmanager still alive terminatez'trying to `terminate()` manager processg?z#manager still alive after terminate)rr rr9rrrhasattrrrrrr_address_to_localr)r r"rZr'rrrrrrWs.         zBaseManager._finalize_managercCs|jS)N)r)r$rrrwszBaseManager.Tc sd|jkr|jj|_dkr"t|p0tdd}|p@tdd}|rxHt|jD]8\}}t|tkstt d|t|tksTt d|qTW|||f|j<|rƇfdd} | _ t || dS)z9 Register a typeid with the manager type rN _exposed__method_to_typeid_z%r is not a stringcs`tjd|jf||\}}||j||j|d}|j|j|jd}t|dd|jf|S)Nz)requesting creation of a shared %r object)managerrZr)rZrS) r rvrrrrr"r9r#)r$r5r6rZexpproxyr)rr!rrrEs  z"BaseManager.register..temp) __dict__rcopy AutoProxyrrrrr:r;r*setattr) rr!rCrrr create_methodkeyrrEr)rr!rregisterys     zBaseManager.register)NNrN)N)NNNNT)r*r,r-r.rrJrr%rrrn classmethodrrrrrrr staticmethodrpropertyr"rrrrrrs*  $    c@seZdZddZddZdS)ProcessLocalSetcCstj|dddS)NcSs|jS)N)clear)rrrrrsz*ProcessLocalSet.__init__..)r register_after_fork)r$rrrr%szProcessLocalSet.__init__cCs t|ffS)N)r)r$rrr __reduce__szProcessLocalSet.__reduce__N)r*r,r-r%rrrrrrsrc@seZdZdZiZejZdddZddZ fifd d Z d d Z d dZ e ddZddZddZddZddZddZdS)rz. A base for proxies of shared objects NTFc Cstj8tjj|jd}|dkr:tjtf}|tj|j<WdQRX|d|_|d|_ ||_ |j j |_ ||_ ||_t|d|_||_|dk rtj||_n"|j dk r|j j|_n tjj|_|r|jtj|tjdS)Nrr)r_mutexrrr"r ZForkAwareLocalr_tls_idset_tokenr#_id_managerrr[r_owned_by_managerr rYrrirZ_increfr _after_fork) r$rrcrrZrrR manager_ownedZ tls_idsetrrrr%s*      zBaseProxy.__init__cCsdtjdtjj}tjjdkr4|dtjj7}|j|jj |j d}t |dd|f||j _ dS)Nzmaking connection to managerZ MainThread|)rZrM)r rvr rirr`rrrr"rr9rr)r$rrrrr_connects  zBaseProxy._connectc Csy |jj}Wn6tk rBtjdtjj|j|jj}YnX|j |j |||f|j \}}|dkrp|S|dkr|\}}|j j |jd } |jj|_| ||j|j |j|d} |j|j|jd}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#PROXYr)rrZr)rZNrS)rrrr rvr`rrrr0rr1rrr!rr"rrrr9r#r2) r$r4r5r6rr7r8rrrrrrr _callmethods,      zBaseProxy._callmethodcCs |jdS)z9 Get a copy of the value of the referent z #GETVALUE)r)r$rrr _getvalueszBaseProxy._getvaluec Cs|jrtjd|jjdS|j|jj|jd}t|dd|j ftjd|jj|j j |j |j oj|j j }tj|tj|j|j||j|j |jfdd|_dS)Nz%owned_by_manager skipped INCREF of %r)rZrRz INCREF %r )r5r)rr rvrr#rr"rr9rraddrrrr_decrefrZ_close)r$rr'rrrr s zBaseProxy._increfcCs|j|j|dks |jtjkry2tjd|j||j|d}t|dd|jfWqt k r}ztjd|WYdd}~XqXntjd|j| rt |drtjdt j j |jj|`dS)Nz DECREF %r)rZrSz... decref failed %sz%DECREF %r -- manager already shutdownrz-thread %r has no more proxies so closing conn)discardr#rrrr rvr"r9rrr`rrrr)rrZr'ZtlsZidsetrrrrrrr s    zBaseProxy._decrefcCsHd|_y |jWn0tk rB}ztjd|WYdd}~XnXdS)Nzincref failed: %s)rrrr r)r$rrrrr9s  zBaseProxy._after_forkcCs^i}tdk r|j|d<t|ddrB|j|d<tt|j|j|ffStt||j|j|ffSdS)NrZ_isautoFr) r rrr RebuildProxyrrrr)r$r6rrrrAs    zBaseProxy.__reduce__cCs|jS)N)r)r$memorrr __deepcopy__NszBaseProxy.__deepcopy__cCsdt|j|jjt|fS)Nz<%s object, typeid %r at %#x>)rr*rr!r#)r$rrrr+QszBaseProxy.__repr__c Cs4y |jdStk r.t|dddSXdS)zV Return representation of the referent (or a fall-back if that fails) r+Nrz; '__str__()' failed>r)rrr)r$rrrrAUs zBaseProxy.__str__)NNNTF)r*r,r-r.rr ZForkAwareThreadLockrr%rrrrrrrrrr+rArrrrrs (   cCsttjdd}|rT|j|jkrTtjd|d|d<|j|jkrT|j|j|j|j<|j ddopttjdd }|||fd|i|S) z5 Function used for unpickling proxy objects. rjNz*Rebuild a proxy owned by manager, token=%rTrrRZ _inheritingF) rr rir"r rvr#r_r]pop)rFrrcr6rrRrrrrbs   rc Csrt|}y |||fStk r(YnXi}x|D]}td||f|q4Wt|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))rrexecrrr)rr_cacheZdicmeth ProxyTyperrr MakeProxyTypews   rTc Cst|d}|dkrB||j|d}zt|dd|f}Wd|jX|dkrX|dk rX|j}|dkrjtjj}td|j |}||||||d} d| _ | S)z* Return an auto-proxy for `token` rN)rZrNz AutoProxy[%s])rrZrRT) r[r"r9rrr rirZrr!r) rrcrrZrrRrrrrrrrrs    rc@seZdZddZddZdS) NamespacecKs|jj|dS)N)rupdate)r$r6rrrr%szNamespace.__init__cCs^t|jj}g}x,|D]$\}}|jds|jd||fqW|jd|jjdj|fS)NrHz%s=%rz%s(%s)z, ) rrr startswithrDrr)r*r)r$rrErrrrrr+s zNamespace.__repr__N)r*r,r-r%r+rrrrrsrc@s8eZdZd ddZddZddZdd ZeeeZd S) ValueTcCs||_||_dS)N) _typecode_value)r$rrlockrrrr%szValue.__init__cCs|jS)N)r)r$rrrrsz Value.getcCs ||_dS)N)r)r$rrrrrsz Value.setcCsdt|j|j|jfS)Nz %s(%r, %r))rr*rr)r$rrrr+szValue.__repr__N)T) r*r,r-r%rrr+rrrrrrrs  rcCs tj||S)N)r)rZsequencerrrrArraysr c@s8eZdZdZddZddZd d Zd d Zd dZdS) IteratorProxy__next__r0throwrcCs|S)Nr)r$rrr__iter__szIteratorProxy.__iter__cGs |jd|S)Nr )r)r$r5rrrr szIteratorProxy.__next__cGs |jd|S)Nr0)r)r$r5rrrr0szIteratorProxy.sendcGs |jd|S)Nr )r)r$r5rrrr szIteratorProxy.throwcGs |jd|S)Nr)r)r$r5rrrrszIteratorProxy.closeN)r r0r r) r*r,r-rr r r0r rrrrrr s r c@s2eZdZd ZdddZddZd d Zd d ZdS) AcquirerProxyacquirereleaseTNcCs"|dkr|fn||f}|jd|S)Nr)r)r$Zblockingrr5rrrrszAcquirerProxy.acquirecCs |jdS)Nr)r)r$rrrrszAcquirerProxy.releasecCs |jdS)Nr)r)r$rrrrszAcquirerProxy.__enter__cCs |jdS)Nr)r)r$rrrrrrrszAcquirerProxy.__exit__)rr)TN)r*r,r-rrrrrrrrrrs  rc@s4eZdZdZdddZd d Zd d Zdd dZdS)ConditionProxyrrrpnotify notify_allNcCs|jd|fS)Nrp)r)r$rrrrrpszConditionProxy.waitcCs |jdS)Nr)r)r$rrrrszConditionProxy.notifycCs |jdS)Nr)r)r$rrrrszConditionProxy.notify_allcCsh|}|r|S|dk r$tj|}nd}d}x6|sb|dk rP|tj}|dkrPP|j||}q.W|S)Nr)timeZ monotonicrp)r$Z predicaterr8ZendtimeZwaittimerrrwait_fors   zConditionProxy.wait_for)rrrprr)N)N)r*r,r-rrprrrrrrrrs  rc@s2eZdZdZddZddZd d Zdd d Zd S) EventProxyrorrrpcCs |jdS)Nro)r)r$rrrroszEventProxy.is_setcCs |jdS)Nr)r)r$rrrrszEventProxy.setcCs |jdS)Nr)r)r$rrrrszEventProxy.clearNcCs|jd|fS)Nrp)r)r$rrrrrpszEventProxy.wait)rorrrp)N)r*r,r-rrorrrprrrrrs rc@sNeZdZdZdddZdd Zd d Zed d ZeddZ eddZ dS) BarrierProxy__getattribute__rpabortresetNcCs|jd|fS)Nrp)r)r$rrrrrp szBarrierProxy.waitcCs |jdS)Nr)r)r$rrrrszBarrierProxy.abortcCs |jdS)Nr)r)r$rrrrszBarrierProxy.resetcCs |jddS)Nrparties)r)r)r$rrrrszBarrierProxy.partiescCs |jddS)Nr n_waiting)r)r)r$rrrrszBarrierProxy.n_waitingcCs |jddS)Nrbroken)r)r)r$rrrrszBarrierProxy.broken)rrprr)N) r*r,r-rrprrrrrrrrrrr s   rc@s(eZdZd ZddZddZdd Zd S) NamespaceProxyr __setattr__ __delattr__cCs0|ddkrtj||Stj|d}|d|fS)NrrHrr)objectr)r$r callmethodrrr __getattr__ s   zNamespaceProxy.__getattr__cCs4|ddkrtj|||Stj|d}|d||fS)NrrHrr)r!rr)r$rrr"rrrr%s  zNamespaceProxy.__setattr__cCs0|ddkrtj||Stj|d}|d|fS)NrrHrr )r!r r)r$rr"rrrr *s   zNamespaceProxy.__delattr__N)rrr )r*r,r-rr#rr rrrrrsrc@s*eZdZdZddZddZeeeZdS) ValueProxyrrcCs |jdS)Nr)r)r$rrrr3szValueProxy.getcCs|jd|fS)Nr)r)r$rrrrr5szValueProxy.setN)rr)r*r,r-rrrrrrrrrr$1sr$ BaseListProxy__add__ __contains__ __delitem__ __getitem____len____mul__ __reversed____rmul__ __setitem__rDcountextendindexinsertrremovereverser__imul__c@seZdZddZddZdS) ListProxycCs|jd|f|S)Nr0)r)r$rrrr__iadd__AszListProxy.__iadd__cCs|jd|f|S)Nr5)r)r$rrrrr5DszListProxy.__imul__N)r*r,r-r7r5rrrrr6@sr6 DictProxyr rrrhas_keypopitem setdefaultrIterator ArrayProxy PoolProxyapply apply_asyncrimapimap_unorderedrmap map_asyncstarmap starmap_asyncrZ AsyncResult)r@rDrFrArBc@seZdZddZddZdS)r>cCs|S)Nr)r$rrrrdszPoolProxy.__enter__cCs |jdS)N)r)r$rrrrrrrfszPoolProxy.__exit__N)r*r,r-rrrrrrr>csc@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 JoinableQueuergraRLock SemaphoreBoundedSemaphore ConditionBarrierPoolrrF)rr)r)rrr)NNNT)T)r&r'r(r)r*r+r,r-r.rDr/r0r1r2rr3r4rr5)r'r(r)r r*r.rrrr9rrrr:r;rr)r*r)r.) r?r@rrArBrrCrDrErFr)I__all__rsr`rZqueuerrrrcontextr r r r r rrrZ view_typesrr Z view_typer!rr9r2rr<rGrIrJrrdreZ XmlListenerZ XmlClientr[rrrrrrrrrr r rrrrrr$r%r6r8rr=Z BasePoolProxyr>rrGrgrarHrIrJrKrLrMrrrrr s             ; ] 4