U ÙAT^õ c@sdddddddddd d d d d ddgZddlZddlZddlZddlZddlmZddlmZmZm Z m Z ddlm Z m Z m Z ddlmZGdd„dejƒZeZejZe ¡eƒ_dd„Zdd„ZGdd„deƒZeZeZd'dd„ZGd d!„d!eƒZd"d „Zd#d$„Z d(d&d„Z!eZ"dS))ÚProcessÚcurrent_processÚactive_childrenÚfreeze_supportÚLockÚRLockÚ SemaphoreÚBoundedSemaphoreÚ ConditionÚEventÚBarrierÚQueueÚManagerÚPipeÚPoolÚ JoinableQueueéNi)r )rrrr)r rr )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)ÚselfZgroupZtargetÚnameZargsZkwargsrrú6/usr/lib64/python3.8/multiprocessing/dummy/__init__.pyr$s  zDummyProcess.__init__cCsN|jtƒk r td |jtƒ¡ƒ‚d|_t|jdƒr>d|jj|<tj  |¡dS)Nz,Parent is {0!r} but current_process is {1!r}Tr) rrZ RuntimeErrorZformatrZhasattrrrrÚstart©rrrrr+s ÿÿ  zDummyProcess.startcCs|jr| ¡sdSdSdS)Nr)rÚis_aliverrrrÚexitcode5szDummyProcess.exitcode)Ú__name__Ú __module__Ú __qualname__rrÚpropertyr!rrrrr"s rcCs2tƒj}t|ƒD]}| ¡s| |d¡qt|ƒS©N)rrÚlistr Zpop)ZchildrenZprrrrDs  cCódSr&rrrrrrKóc@seZdZdd„Zdd„ZdS)Ú NamespacecKs|j |¡dSr&)Ú__dict__Zupdate)rZkwdsrrrrSr)zNamespace.__init__cCsZt|j ¡ƒ}g}|D]$\}}| d¡s| d||f¡q| ¡d|jjd |¡fS)NZ_z%s=%rz%s(%s)z, ) r'r+ÚitemsZ startswithZappendZsortZ __class__r"Zjoin)rr,ZtemprÚvaluerrrÚ__repr__Us  zNamespace.__repr__N)r"r#r$rr.rrrrr*Rsr*TcCs t ||¡Sr&)Úarray)ÚtypecodeZsequenceÚlockrrrÚArrayar)r2c@s8eZdZd dd„Zedd„ƒZejdd„ƒZdd„Zd S) ÚValueTcCs||_||_dSr&)Ú _typecodeÚ_value)rr0r-r1rrrreszValue.__init__cCs|jSr&©r5rrrrr-ióz Value.valuecCs ||_dSr&r6)rr-rrrr-mr7cCsdt|ƒj|j|jfS)Nz <%s(%r, %r)>)Ztyper"r4r5rrrrr.qr)zValue.__repr__N©T)r"r#r$rr%r-Zsetterr.rrrrr3ds    r3cCs tjtSr&)ÚsysZmodulesr"rrrrr tr)cCr(r&rrrrrÚshutdownwr)r:rcCsddlm}||||ƒS)Ni)Ú ThreadPool)Zpoolr;)Z processesZ initializerZinitargsr;rrrrzs r8)NNr)#Z__all__rr9rr/Z connectionr rrrrr rr Zqueuer rrrZcurrent_threadrrrrrZobjectr*Zdictr'r2r3r r:rrrrrrZ sNý