Ë ‚Ö¦i3Jãó`—dZdZddlZddlZddlmZddlmZGd„d«ZGd „d eej«Z Gd „d ej«Z Gd „deej«Z Gd„deej«Z Gd„de «Z Gd„dej«ZGd„dej«Zy)zSynchronization primitives.)ÚLockÚEventÚ ConditionÚ SemaphoreÚBoundedSemaphoreÚBarrieréNé)Ú exceptions)Úmixinscó—eZdZd„Zd„Zy)Ú_ContextManagerMixincƒó@K—|j«ƒd{–—†y7Œ­w©N)Úacquire©Úselfs ú&/usr/lib64/python3.12/asyncio/locks.pyÚ __aenter__z_ContextManagerMixin.__aenter__ sèø€Ø�l‰l‹n×Ððð ús ‚–—cƒó,K—|j«y­wr)Úrelease)rÚexc_typeÚexcÚtbs rÚ __aexit__z_ContextManagerMixin.__aexit__sèø€Ø � ‰ �ùs‚N)Ú__name__Ú __module__Ú __qualname__rr©órr r s „òó rr có@‡—eZdZdZd„Zˆfd„Zd„Zd„Zd„Zd„Z ˆxZ S)ra�Primitive lock objects. A primitive lock is a synchronization primitive that is not owned by a particular coroutine when locked. A primitive lock is in one of two states, 'locked' or 'unlocked'. It is created in the unlocked state. It has two basic methods, acquire() and release(). When the state is unlocked, acquire() changes the state to locked and returns immediately. When the state is locked, acquire() blocks until a call to release() in another coroutine changes it to unlocked, then the acquire() call resets it to locked and returns. The release() method should only be called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a RuntimeError will be raised. When more than one coroutine is blocked in acquire() waiting for the state to turn to unlocked, only one coroutine proceeds when a release() call resets the state to unlocked; first coroutine which is blocked in acquire() is being processed. acquire() is a coroutine and should be called with 'await'. Locks also support the asynchronous context management protocol. 'async with lock' statement should be used. Usage: lock = Lock() ... await lock.acquire() try: ... finally: lock.release() Context manager usage: lock = Lock() ... async with lock: ... Lock objects can be tested for locking state: if not lock.locked(): await lock.acquire() else: # lock is acquired ... có —d|_d|_y©NF)Ú_waitersÚ_lockedrs rÚ__init__z Lock.__init__Ms€ØˆŒ ؈� rc󤕗t‰|�«}|jrdnd}|jr|›dt |j«›�}d|dd›d|›d�S© NÚlockedÚunlockedú , waiters:Ú)ÚsuperÚ__repr__r$r#Úlen©rÚresÚextraÚ __class__s €rr0z Lock.__repr__QsYø€Ü‰gÑÓ ˆØ ŸLšL‘¨jˆØ �=Š=Ø�g˜Z¬¨D¯M©MÓ(:Ð';Ð<ˆEØ�3�q˜�9�+˜R ˜w bÐ)Ð)rcó—|jS)z Return True if lock is acquired.)r$rs rr(z Lock.lockedXs €à�|‰|ÐrcƒóJK—|js0|j�td„|jD««rd|_y|j€tj«|_|j «j «}|jj|« |ƒd{–—†|jj|« d|_y7Œ(#|jj|«wxYw#tj$r|js|j«‚wxYw­w)z�Acquire a lock. This method blocks until the lock is unlocked, then sets it to locked and returns True. Nc3ó<K—|]}|j«–—Œy­wr©Ú cancelled©Ú.0Úws rÚ zLock.acquire..csèø€Ð9©= a�A—K‘K—M©=ùs‚T) r$r#ÚallÚ collectionsÚdequeÚ _get_loopÚ create_futureÚappendÚremover ÚCancelledErrorÚ_wake_up_first©rÚfuts rrz Lock.acquire\sæèø€ð — ’  $§-¡-Ð"7ÜÑ9¨4¯=ª=Ó9Ô9؈DŒLØà �=‰=Ð Ü'×-Ñ-Ó/ˆDŒMØ�n‰nÓ×,Ñ,Ó.ˆØ � ‰ ×јSÔ!ð  ð *Ø— � à— ‘ ×$Ñ$ SÕ)𠈌 Øðùà— ‘ ×$Ñ$ SÕ)ûÜ×(Ñ(ò Ø—<’<Ø×#Ñ#Ô%Ø ð üsB‚BD#ÂCÂ$C Â%CÂ)C/ÃD#à CÃC,Ã,C/Ã/1D Ä D#có`—|jrd|_|j«ytd«‚)aGRelease a lock. When the lock is locked, reset it to unlocked, and return. If any other coroutines are blocked waiting for the lock to become unlocked, allow exactly one of them to proceed. When invoked on an unlocked lock, a RuntimeError is raised. There is no return value. FzLock is not acquired.N)r$rGÚ RuntimeErrorrs rrz Lock.release|s*€ð �<Š<Ø ˆDŒLØ × Ñ Õ !äÐ6Ó7Ð 7rcó¾—|jsy tt|j««}|j «s|j d«yy#t$rYywxYw)z*Wake up the first waiter if it isn't done.NT)r#ÚnextÚiterÚ StopIterationÚdoneÚ set_resultrHs rrGzLock._wake_up_first�sT€à�}Š}Ø ð Ü”t˜DŸM™MÓ*Ó+ˆCð�x‰xŒzØ �N‰N˜4Õ ðøô ò Ù ð ús�AÁ AÁA) rrrÚ__doc__r%r0r(rrrGÚ __classcell__©r5s@rrrs(ø„ñ3òjô*òòò@8ö" !rrcó@‡—eZdZdZd„Zˆfd„Zd„Zd„Zd„Zd„Z ˆxZ S)ra#Asynchronous equivalent to threading.Event. Class implementing event objects. An event manages a flag that can be set to true with the set() method and reset to false with the clear() method. The wait() method blocks until the flag is true. The flag is initially false. cóD—tj«|_d|_yr")r@rAr#Ú_valuers rr%zEvent.__init__¦s€Ü#×)Ñ)Ó+ˆŒ ؈� rc󤕗t‰|�«}|jrdnd}|jr|›dt |j«›�}d|dd›d|›d�S) NÚsetÚunsetr*r+r r,r-r.)r/r0rWr#r1r2s €rr0zEvent.__repr__ªsYø€Ü‰gÑÓ ˆØŸš‘¨'ˆØ �=Š=Ø�g˜Z¬¨D¯M©MÓ(:Ð';Ð<ˆEØ�3�q˜�9�+˜R ˜w bÐ)Ð)rcó—|jS)z5Return True if and only if the internal flag is true.©rWrs rÚis_setz Event.is_set±s €à�{‰{Ðrcó’—|js;d|_|jD]$}|j«rŒ|jd«Œ&yy)zºSet the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutine that call wait() once the flag is true will not block at all. TN)rWr#rPrQrHs rrYz Event.setµs:€ð �{Š{؈DŒKà—}”}�Ø—x‘x•zØ—N‘N 4Õ(ñ%ðrcó—d|_y)z¢Reset the internal flag to false. Subsequently, coroutines calling wait() will block until set() is called to set the internal flag to true again.FNr\rs rÚclearz Event.clearÁs €ðˆ� rcƒó*K—|jry|j«j«}|jj |« |ƒd{–—† |jj |«y7Œ!#|jj |«wxYw­w)zéBlock until the internal flag is true. If the internal flag is true on entry, return True immediately. Otherwise, block until another coroutine calls set() to set the flag to true, then return True. TN)rWrBrCr#rDrErHs rÚwaitz Event.waitÇstèø€ð �;Š;Øà�n‰nÓ×,Ñ,Ó.ˆØ � ‰ ×јSÔ!ð &Ø�IˆIØà �M‰M× Ñ  Õ %ð ùð �M‰M× Ñ  Õ %üs0‚ABÁ A3ÁA1ÁA3ÁBÁ1A3Á3BÂB) rrrrRr%r0r]rYr`rbrSrTs@rrr�s&ø„ñòô*òò )òö &rrcóD‡—eZdZdZdd„Zˆfd„Zd„Zd„Zd d„Zd„Z ˆxZ S) raAsynchronous equivalent to threading.Condition. This class implements condition variable objects. A condition variable allows one or more coroutines to wait until they are notified by another coroutine. A new Lock object is created and used as the underlying lock. có—|€ t«}||_|j|_|j|_|j|_t j «|_yr)rÚ_lockr(rrr@rAr#)rÚlocks rr%zCondition.__init__äsF€Ø ˆ<Ü“6ˆDàˆŒ à—k‘kˆŒ Ø—|‘|ˆŒ Ø—|‘|ˆŒ ä#×)Ñ)Ó+ˆ� rc󬕗t‰|�«}|j«rdnd}|jr|›dt |j«›�}d|dd›d|›d�Sr')r/r0r(r#r1r2s €rr0zCondition.__repr__ðs[ø€Ü‰gÑÓ ˆØ ŸK™KœM‘¨zˆØ �=Š=Ø�g˜Z¬¨D¯M©MÓ(:Ð';Ð<ˆEØ�3�q˜�9�+˜R ˜w bÐ)Ð)rcƒó¤K—|j«s td«‚|j« |j«j «}|j j |« |ƒd{–—† |j j|«d} |j«ƒd{–—† |rtj‚y7ŒP7Œ#tj$rd}YnwxYwŒM#|j j|«wxYw#d} |j«ƒd{–—†7n#tj$rd}YnwxYwŒ7|rtj‚wxYw­w)ašWait until notified. If the calling coroutine has not acquired the lock when this method is called, a RuntimeError is raised. This method releases the underlying lock, and then blocks until it is awakened by a notify() or notify_all() call for the same condition variable in another coroutine. Once awakened, it re-acquires the lock and returns True. zcannot wait on un-acquired lockNFT) r(rKrrBrCr#rDrErr rF)rrIr:s rrbzCondition.wait÷s@èø€ð�{‰{Œ}ÜÐ@ÓAÐ Aà � ‰ Œð 0Ø—.‘.Ó"×0Ñ0Ó2ˆCØ �M‰M× Ñ  Ô %ð *Ø— � Øà— ‘ ×$Ñ$ SÔ)ðˆIØð%ØŸ,™,›.×(Ð(ØñÜ ×/Ñ/Ð/ððøð)ùä!×0Ñ0ò%Ø $’Ið%úð øð — ‘ ×$Ñ$ SÕ)ûðˆIØð%ØŸ,™,›.×(Ñ(ØøÜ!×0Ñ0ò%Ø $’Ið%úð ñÜ ×/Ñ/Ð/ðüs¬‚,E¯9C?Á)CÁ.B?Á/CÁ4C?ÂEÂCÂ&CÂ'CÂ+EÂ?CÃCÃCÃEÃCÃEÃC<Ã<C?Ã?E ÄDÄDÄDÄE ÄD6Ä3E Ä5D6Ä6E Å EcƒóhK—|«}|s"|j«ƒd{–—†|«}|sŒ"|S7Œ­w)zÎWait until a predicate becomes true. The predicate should be a callable which result will be interpreted as a boolean value. The final predicate value is the return value. N©rb)rÚ predicateÚresults rÚwait_forzCondition.wait_fors9èø€ñ“ˆÙØ—)‘)“+× Ð Ù“[ˆFòðˆ ð ús‚2Ÿ0  2®2có¼—|j«s td«‚d}|jD]0}||k\ry|j«rŒ|dz }|j d«Œ2y)aBy default, wake up one coroutine waiting on this condition, if any. If the calling coroutine has not acquired the lock when this method is called, a RuntimeError is raised. This method wakes up at most n of the coroutines waiting for the condition variable; it is a no-op if no coroutines are waiting. Note: an awakened coroutine does not actually return from its wait() call until it can reacquire the lock. Since notify() does not release the lock, its caller should. z!cannot notify on un-acquired lockrr FN)r(rKr#rPrQ)rÚnÚidxrIs rÚnotifyzCondition.notify)sT€ð�{‰{Œ}ÜÐBÓCÐ CàˆØ—=”=ˆCØ�aŠxÙà—8‘8•:Ø�q‘�Ø—‘˜uÕ%ñ !rcóL—|jt|j««y)aWake up all threads waiting on this condition. This method acts like notify(), but wakes up all waiting threads instead of one. If the calling thread has not acquired the lock when this method is called, a RuntimeError is raised. N)rqr1r#rs rÚ notify_allzCondition.notify_allAs€ð � ‰ ”C˜Ÿ ™ Ó&Õ'rr©r ) rrrrRr%r0rbrmrqrsrSrTs@rrrÚs'ø„ñó ,ô*ò#0òJ ó&ö0(rrcóB‡—eZdZdZdd„Zˆfd„Zd„Zd„Zd„Zd„Z ˆxZ S) raA Semaphore implementation. A semaphore manages an internal counter which is decremented by each acquire() call and incremented by each release() call. The counter can never go below zero; when acquire() finds that it is zero, it blocks, waiting until some other thread calls release(). Semaphores also support the context management protocol. The optional argument gives the initial value for the internal counter; it defaults to 1. If the value given is less than 0, ValueError is raised. có@—|dkr td«‚d|_||_y)Nrz$Semaphore initial value must be >= 0)Ú ValueErrorr#rW)rÚvalues rr%zSemaphore.__init__Ys#€Ø �1Š9ÜÐCÓDÐ D؈Œ ؈� rcóÆ•—t‰|�«}|j«rdnd|j›�}|jr|›dt |j«›�}d|dd›d|›d�S) Nr(zunlocked, value:r*r+r r,r-r.)r/r0r(rWr#r1r2s €rr0zSemaphore.__repr___sgø€Ü‰gÑÓ ˆØ ŸK™KœM‘Ð1AÀ$Ç+Á+ÀÐ/OˆØ �=Š=Ø�g˜Z¬¨D¯M©MÓ(:Ð';Ð<ˆEØ�3�q˜�9�+˜R ˜w bÐ)Ð)rcód—|jdk(xs td„|jxsdD««S)z9Returns True if semaphore cannot be acquired immediately.rc3ó>K—|]}|j« –—Œy­wrr9r;s rr>z#Semaphore.locked..isèø€ÐAÑ,? a�A—K‘K“MÔ!Ñ,?ùs‚r)rWÚanyr#rs rr(zSemaphore.lockedfs4€à�{‰{˜aÑòCÜ ÑA¨D¯M©MÒ,?¸RÐ,?ÓAÓ Að Crcƒó€K—|j«s|xjdzc_y|j€tj«|_|j «j «}|jj|« |ƒd{–—†|jj|« |jdkDr|j«y7Œ@#|jj|«wxYw#tj$r7|j«s%|xjdz c_|j«‚wxYw­w)a5Acquire a semaphore. If the internal counter is larger than zero on entry, decrement it by one and return True immediately. If it is zero on entry, block, waiting until some other coroutine has called release() to make it larger than 0, and then return True. r TNr) r(rWr#r@rArBrCrDrEr rFr:Ú _wake_up_nextrHs rrzSemaphore.acquireksôèø€ð�{‰{Œ}Ø �KŠK˜1Ñ �KØà �=‰=Ð Ü'×-Ñ-Ó/ˆDŒMØ�n‰nÓ×,Ñ,Ó.ˆØ � ‰ ×јSÔ!ð ð *Ø— � à— ‘ ×$Ñ$ SÕ)ð �;‰;˜Š?Ø × Ñ Ô Øðùà— ‘ ×$Ñ$ SÕ)ûÜ×(Ñ(ò Ø—=‘=”?Ø— ’ ˜qÑ • Ø×"Ñ"Ô$Ø ð  üsC‚BD> CÂCÂCÂC1Â.!D>ÃCÃC.Ã.C1Ã1A D;Ä;D>cóN—|xjdz c_|j«y)zÔRelease a semaphore, incrementing the internal counter by one. When it was zero on entry and another coroutine is waiting for it to become larger than zero again, wake up that coroutine. r N)rWr~rs rrzSemaphore.release�s€ð � Š �qÑ� Ø ×ÑÕrcó°—|jsy|jD]:}|j«rŒ|xjdzc_|jd«yy)z)Wake up the first waiter that isn't done.Nr T)r#rPrWrQrHs rr~zSemaphore._wake_up_next˜s@€à�}Š}Ø à—=”=ˆCØ—8‘8•:Ø— ’ ˜qÑ • Ø—‘˜tÔ$Ùñ !rrt) rrrrRr%r0r(rrr~rSrTs@rrrJs(ø„ñ óô *òCò "òHö rrcó.‡—eZdZdZdˆfd„ Zˆfd„ZˆxZS)rz�A bounded semaphore implementation. This raises ValueError in release() if it would increase the value above the initial value. có2•—||_t‰|� |«yr)Ú _bound_valuer/r%)rrxr5s €rr%zBoundedSemaphore.__init__«sø€Ø!ˆÔÜ ‰Ñ˜Õrcój•—|j|jk\r td«‚t‰|�«y)Nz(BoundedSemaphore released too many times)rWrƒrwr/r)rr5s €rrzBoundedSemaphore.release¯s+ø€Ø �;‰;˜$×+Ñ+Ò +ÜÐGÓHÐ HÜ ‰‰Õrrt)rrrrRr%rrSrTs@rrr¤sø„ñõ  ÷ðrrcó—eZdZdZdZdZdZy)Ú _BarrierStateÚfillingÚdrainingÚ resettingÚbrokenN)rrrÚFILLINGÚDRAININGÚ RESETTINGÚBROKENrrrr†r†¶s„Ø€GØ€HØ€IØ �Frr†c󎇗eZdZdZd„Zˆfd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zed „«Zed„«Zed„«ZˆxZS)ra Asyncio equivalent to threading.Barrier Implements a Barrier primitive. Useful for synchronizing a fixed number of tasks at known synchronization points. Tasks block on 'wait()' and are simultaneously awoken once they have all made their call. cóˆ—|dkr td«‚t«|_||_tj |_d|_y)z1Create a barrier, initialised to 'parties' tasks.r zparties must be >= 1rN)rwrÚ_condÚ_partiesr†r‹Ú_stateÚ_count)rÚpartiess rr%zBarrier.__init__Æs9€à �QŠ;ÜÐ3Ó4Ð 4ä“[ˆŒ àˆŒ Ü#×+Ñ+ˆŒ ؈� rc󼕗t‰|�«}|jj›}|js|d|j ›d|j ›�z }d|dd›d|›d�S)Nr*Ú/r+r r,r-r.)r/r0r“rxrŠÚ n_waitingr•r2s €rr0zBarrier.__repr__Ñsdø€Ü‰gÑÓ ˆØ—;‘;×$Ñ$Ð%ˆØ�{Š{Ø �z $§.¡.Ð!1°°4·<±<°.ÐAÑ AˆEØ�3�q˜�9�+˜R ˜w bÐ)Ð)rcƒó>K—|j«ƒd{–—†S7Œ­wrrjrs rrzBarrier.__aenter__Øsèø€ð—Y‘Y“[× Ð Ð ús ‚–—c‡ó K—y­wrr)rÚargss rrzBarrier.__aexit__Ýs èø€Ø ùs‚cƒó0K—|j4ƒd{–—†|j«ƒd{–—† |j}|xjdz c_|dz|jk(r|j «ƒd{–—†n|j «ƒd{–—†||xjdzc_|j «cddd«ƒd{–—†S7Œ¹7Œ£7ŒY7ŒB7Œ #|xjdzc_|j «wxYw#1ƒd{–—†7swYyxYw­w)zÙWait for the barrier. When the specified number of tasks have started waiting, they are all simultaneously awoken. Returns an unique and individual index number from 0 to 'parties-1'. Nr )r‘Ú_blockr”r’Ú_releaseÚ_waitÚ_exit)rÚindexs rrbz Barrier.waitàsÅèø€ð—:—:“:Ø—+‘+“-× Ð ð ØŸ ™ �Ø— ’ ˜qÑ • ؘ1‘9 § ¡ Ò-àŸ-™-›/×)Ñ)àŸ*™*›,×&Ð&Øà— ’ ˜qÑ • à— ‘ ” ÷—:’:øØ øð *øà&øðùð— ’ ˜qÑ • à— ‘ • ú÷—:‘:üs�‚D“C ”D—D«C¬D±ACÁ7CÁ8CÂCÂCÂ%DÂ; DÃCÃDÃDÃCÃCÃDÃ'C>Ã>DÄDÄD ÄDÄDcƒóÀ‡K—‰jjˆfd„«ƒd{–—†‰jtjurt j d«‚y7Œ6­w)Ncó\•—‰jtjtjfvSr)r“r†rŒr�rs€rÚz Barrier._block..þs$ø€�D—K‘KÜ×&Ñ&¬ ×(?Ñ(?ð(ñrzBarrier aborted)r‘rmr“r†rŽr ÚBrokenBarrierErrorrs`rr�zBarrier._block÷sZøèø€ð �j‰j×!Ñ!ó ó ÷ ð ð �;‰;œ-×.Ñ.Ñ .Ü×/Ñ/Ð0AÓBÐ Bð /ð úsƒ"A¥A¦7AcƒójK—tj|_|jj «y­wr)r†rŒr“r‘rsrs rržzBarrier._releases%èø€ô $×,Ñ,ˆŒ Ø � ‰ ×ÑÕùs‚13cƒóà‡K—‰jjˆfd„«ƒd{–—†‰jtjtj fvrt jd«‚y7ŒF­w)Ncó<•—‰jtjuSr)r“r†r‹rs€rr¤zBarrier._wait..sø€¨$¯+©+¼]×=RÑ=RÑ*RrzAbort or reset of barrier)r‘rmr“r†rŽr�r r¥rs`rrŸz Barrier._waits]øèø€ð �j‰j×!Ñ!Ó"RÓS×SÐSà �;‰;œ=×/Ñ/´×1HÑ1HÐIÑ IÜ×/Ñ/Ð0KÓLÐ Lð Jð Túsƒ"A.¥A,¦AA.cóÚ—|jdk(r\|jtjtjfvrtj |_|j j«yy)Nr)r”r“r†r�rŒr‹r‘rsrs rr z Barrier._exitsO€ð �;‰;˜!Ò Ø�{‰{œ}×6Ñ6¼ ×8NÑ8NÐOÑOÜ+×3Ñ3�” Ø �J‰J× !Ñ !Õ #ð rcƒóhK—|j4ƒd{–—†|jdkDr2|jtjur+tj|_ntj |_|jj «ddd«ƒd{–—†y7Œ…7Œ#1ƒd{–—†7swYyxYw­w)zŠReset the barrier to the initial state. Any tasks currently waiting will get the BrokenBarrier exception raised. Nr)r‘r”r“r†r�r‹rsrs rÚresetz Barrier.reset"skèø€ð —:—:“:Ø�{‰{˜QŠØ—;‘;¤m×&=Ñ&=Ñ=ä"/×"9Ñ"9�D•Kä+×3Ñ3�” Ø �J‰J× !Ñ !Ô #÷—:‘:ø�:ø—:—:‘:üsE‚B2“B”B2—A1B B2ÂBÂB2ÂB2ÂB/Â#B& Â$B/Â+B2cƒóæK—|j4ƒd{–—†tj|_|jj «ddd«ƒd{–—†y7ŒD7Œ#1ƒd{–—†7swYyxYw­w)z¾Place the barrier into a 'broken' state. Useful in case of error. Any currently waiting tasks and tasks attempting to 'wait()' will have BrokenBarrierError raised. N)r‘r†rŽr“rsrs rÚabortz Barrier.abort1sAèø€ð —:—:“:Ü'×.Ñ.ˆDŒKØ �J‰J× !Ñ !Ô #÷—:‘:ø�:ø—:—:‘:üsD‚A1“A”A1—0AÁ A1ÁAÁA1ÁA1ÁA.Á"A% Á#A.Á*A1có—|jS)z8Return the number of tasks required to trip the barrier.)r’rs rr•zBarrier.parties;s€ð�}‰}ÐrcóT—|jtjur |jSy)zr·s²ðÙ!ð *€óÛ åÝ÷ñôC!Ð  ×!7Ñ!7ôC!ôL:&ˆF× "Ñ "ô:&ôzm(Ð$ f×&<Ñ&<ôm(ô`WÐ$ f×&<Ñ&<ôWôt�yôô$�D—I‘IôôM3ˆf×$Ñ$õM3r