o […dõ ã@søgd¢ZddlZddlZddlZddlZddlmZddlmZmZm Z m Z ddlm Z m Z m Z ddlmZGdd „d ejƒZeZejZe ¡eƒ_d d „Zd d „ZGdd„deƒZeZeZddd„ZGdd„deƒZdd„Zdd„Z ddd„Z!eZ"dS))ÚProcessÚcurrent_processÚactive_childrenÚfreeze_supportÚLockÚRLockÚ SemaphoreÚBoundedSemaphoreÚ ConditionÚEventÚBarrierÚQueueÚManagerÚPipeÚPoolÚ JoinableQueueéNé)r)rrrr)r r r )r c@s4eZdZddddifdd„Zdd„Zedd„ƒZdS) Ú DummyProcessN©cCs8tj ||||||¡d|_t ¡|_d|_tƒ|_ dS)NF) Ú threadingÚThreadÚ__init__Ú_pidÚweakrefÚWeakKeyDictionaryÚ _childrenÚ _start_calledrÚ_parent)ÚselfÚgroupÚtargetÚnameÚargsÚkwargsrrú5/usr/lib/python3.10/multiprocessing/dummy/__init__.pyr$s   zDummyProcess.__init__cCsN|jtƒurtd |jtƒ¡ƒ‚d|_t|jdƒrd|jj|<tj  |¡dS)Nz,Parent is {0!r} but current_process is {1!r}Tr) rrÚ RuntimeErrorÚformatrÚhasattrrrrÚstart©rrrr$r(+s ÿÿ  zDummyProcess.startcCs|jr | ¡s dSdS)Nr)rÚis_aliver)rrr$Úexitcode5szDummyProcess.exitcode)Ú__name__Ú __module__Ú __qualname__rr(Úpropertyr+rrrr$r"s  rcCs2tƒj}t|ƒD] }| ¡s| |d¡qt|ƒS©N)rrÚlistr*Úpop)ÚchildrenÚprrr$rDs   €rcCódSr0rrrrr$rKórc@seZdZdd„Zdd„ZdS)Ú NamespacecKs|j |¡dSr0)Ú__dict__Úupdate)rÚkwdsrrr$rSszNamespace.__init__cCsZt|j ¡ƒ}g}|D]\}}| d¡s| d||f¡q | ¡d|jjd |¡fS)NÚ_z%s=%rz%s(%s)z, ) r1r8ÚitemsÚ startswithÚappendÚsortÚ __class__r,Újoin)rr<Útempr!Úvaluerrr$Ú__repr__Us  €zNamespace.__repr__N)r,r-r.rrDrrrr$r7Rs r7TcCs t ||¡Sr0)Úarray)ÚtypecodeÚsequenceÚlockrrr$ÚArrayas rIc@s8eZdZd dd„Zedd„ƒZejdd„ƒZdd„Zd S) ÚValueTcCs||_||_dSr0)Ú _typecodeÚ_value)rrFrCrHrrr$res zValue.__init__cCs|jSr0©rLr)rrr$rCisz Value.valuecCs ||_dSr0rM)rrCrrr$rCms cCsdt|ƒj|j|jfS)Nz <%s(%r, %r)>)Útyper,rKrLr)rrr$rDqszValue.__repr__N©T)r,r-r.rr/rCÚsetterrDrrrr$rJds    rJcCs tjtSr0)ÚsysÚmodulesr,rrrr$r ts r cCr5r0rrrrr$Úshutdownwr6rSrcCsddlm}||||ƒS)Né)Ú ThreadPool)ÚpoolrU)Ú processesÚ initializerÚinitargsrUrrr$rzs  rrO)NNr)#Ú__all__rrQrrEÚ connectionrrrrrr r r Úqueuer rrrÚcurrent_threadrrrrrÚobjectr7Údictr1rIrJr rSrrrrrr$Ús0