a ÕDOgõ ã@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__Z_pidÚweakrefÚWeakKeyDictionaryÚ _childrenÚ _start_calledrÚ_parent)ÚselfÚgroupÚtargetÚnameÚargsÚkwargsrrúC/opt/alt/python39/lib64/python3.9/multiprocessing/dummy/__init__.pyr$s  zDummyProcess.__init__cCsN|jtƒur td |jtƒ¡ƒ‚d|_t|jdƒr>d|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| ¡sdSdSdS)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)ZchildrenÚprrr#rDs  rcCsdSr/rrrrr#rKsrc@seZdZdd„Zdd„ZdS)Ú NamespacecKs|j |¡dSr/)Ú__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, ) r0r4ÚitemsÚ startswithÚappendÚsortÚ __class__r+Újoin)rr8Ztempr Úvaluerrr#Ú__repr__Us  zNamespace.__repr__N)r+r,r-rr?rrrr#r3Rsr3TcCs t ||¡Sr/)Úarray)ÚtypecodeZsequenceÚlockrrr#ÚArrayasrCc@s8eZdZd dd„Zedd„ƒZejdd„ƒZdd„Zd S) ÚValueTcCs||_||_dSr/)Ú _typecodeÚ_value)rrAr>rBrrr#reszValue.__init__cCs|jSr/©rFr(rrr#r>isz Value.valuecCs ||_dSr/rG)rr>rrr#r>mscCsdt|ƒj|j|jfS)Nz <%s(%r, %r)>)Útyper+rErFr(rrr#r?qszValue.__repr__N)T)r+r,r-rr.r>Úsetterr?rrrr#rDds    rDcCs tjtSr/)ÚsysÚmodulesr+rrrr#r tsr cCsdSr/rrrrr#ÚshutdownwsrLrcCsddlm}||||ƒS)Né)Ú ThreadPool)ZpoolrN)Z processesZ initializerZinitargsrNrrr#rzs r)T)NNr)#Ú__all__rrJrr@Z connectionrrrrrr r r Zqueuer rrrZcurrent_threadrrrrrÚobjectr3Údictr0rCrDr rLrrrrrr#Ú s.