+
    LV-j;!  ã                  óÆ   € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^RIHt ]
'       d   ^ RIt^ RIHtHt ^ RIHt ^ R	IHt  ! R
 R4      t ! R R4      tRR.tR# )zEAsync wrapper around :class:`ReadWriteLock` for use with ``asyncio``.)ÚannotationsN)ÚThreadPoolExecutor)Úasynccontextmanager)ÚTYPE_CHECKING)ÚReadWriteLock)ÚAsyncGeneratorÚCallable)Úfutures)ÚTracebackTypec                  ó>   € ] tR t^tRtR R ltR R ltR R ltRtR	# )
Ú AsyncAcquireReadWriteReturnProxyzEContext-aware object that releases the async read/write lock on exit.c               ó    € V ^8„  d   QhRRRR/# )é   ÚlockÚAsyncReadWriteLockÚreturnÚNone© )Úformats   "Úk/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/filelock/_async_read_write.pyÚ__annotate__Ú-AsyncAcquireReadWriteReturnProxy.__annotate__   s   € ÷ ñ Ð/ð °Dñ ó    c                	ó   € Wn         R # ©N©r   )Úselfr   s   &&r   Ú__init__Ú)AsyncAcquireReadWriteReturnProxy.__init__   s   € ØŽ	r   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   r      s   € ÷ ñ Ð"4ñ r   c              ƒ  	ó"   "  € V P                   # 5ir   r   ©r   s   &r   Ú
__aenter__Ú+AsyncAcquireReadWriteReturnProxy.__aenter__   s   é € Ø�y‰yÐùs   ‚c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   Úexc_typeztype[BaseException] | NoneÚ	exc_valuezBaseException | NoneÚ	tracebackzTracebackType | Noner   r   r   )r   s   "r   r   r      s2   € ÷ "ñ "à,ð"ð (ð"ð (ð	"ð
 
ñ"r   c              ƒ  	óV   "  € V P                   P                  4       G R j  x€L
  R #  L5ir   )r   Úrelease)r   r%   r&   r'   s   &&&&r   Ú	__aexit__Ú*AsyncAcquireReadWriteReturnProxy.__aexit__   s   é € ð �i‰i×ÑÓ!×!Ô!ùs   ‚) '¡)r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r"   r*   Ú__static_attributes__r   r   r   r   r      s   † ÙOõõ÷"ñ "r   r   c            	      óX  € ] tR t^&tRtR'RRRRRRRR/R R	 lllt]R
 R l4       t]R R l4       t]R R l4       t	]R R l4       t
]R R l4       tR R ltR'RR/R R llltR'RR/R R llltRR/R R llt]R(RR/R R lll4       t]R(RR/R  R! lll4       tR" R# ltR$ R% ltR&tR# ))r   aÓ  
Async wrapper around :class:`ReadWriteLock` for use in ``asyncio`` applications.

Because Python's :mod:`sqlite3` module has no async API, all blocking SQLite operations are dispatched to a thread
pool via ``loop.run_in_executor()``. Reentrancy, upgrade/downgrade rules, and singleton behavior are delegated
to the underlying :class:`ReadWriteLock`.

:param lock_file: path to the SQLite database file used as the lock
:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable
:param is_singleton: if ``True``, reuse existing :class:`ReadWriteLock` instances for the same resolved path
:param loop: event loop for ``run_in_executor``; ``None`` uses the running loop
:param executor: executor for ``run_in_executor``. When ``None`` a dedicated single-thread executor is created
    and owned by this lock, ensuring every operation runs on the same thread (required for SQLite affinity); it
    is shut down by :meth:`close`. A caller-supplied executor is used as-is and never shut down here, so when no
    executor is passed remember to call :meth:`close` to release the owned one.

.. versionadded:: 3.21.0

ÚblockingTÚis_singletonÚloopNÚexecutorc               ó4   € V ^8„  d   QhRRRRRRRRRR	R
RRR/# )r   Ú	lock_filezstr | os.PathLike[str]ÚtimeoutÚfloatr3   Úboolr4   r5   ú asyncio.AbstractEventLoop | Noner6   zfutures.Executor | Noner   r   r   )r   s   "r   r   ÚAsyncReadWriteLock.__annotate__<   sY   € ÷ Gñ Gà)ðGð ðGð
 ðGð ðGð /ðGð *ðGð 
ñGr   c               	ó~   € \        WW4R 7      V n        WPn        VRJ V n        T;'       g    \	        ^R7      V n        R# ))r3   r4   N)Úmax_workers)r   Ú_lockÚ_loopÚ_owns_executorr   Ú	_executor)r   r8   r9   r3   r4   r5   r6   s   &&&$$$$r   r   ÚAsyncReadWriteLock.__init__<   s9   € ô # 9ÀÔdˆŒ
ØŒ
Ø&¨$Ð.ˆÔØ!×FÐFÔ%7ÀAÔ%FˆŽr   c               ó   € V ^8„  d   QhRR/# )r   r   Ústrr   )r   s   "r   r   r=   L   s   € ÷ $ñ $˜3ñ $r   c                ó.   € V P                   P                  # )z$:returns: the path to the lock file.)r@   r8   r!   s   &r   r8   ÚAsyncReadWriteLock.lock_fileK   s   € ð �z‰z×#Ñ#Ð#r   c               ó   € V ^8„  d   QhRR/# )r   r   r:   r   )r   s   "r   r   r=   Q   s   € ÷ "ñ "˜ñ "r   c                ó.   € V P                   P                  # )z:returns: the default timeout.)r@   r9   r!   s   &r   r9   ÚAsyncReadWriteLock.timeoutP   s   € ð �z‰z×!Ñ!Ð!r   c               ó   € V ^8„  d   QhRR/# )r   r   r;   r   )r   s   "r   r   r=   V   s   € ÷ #ñ #˜$ñ #r   c                ó.   € V P                   P                  # )z1:returns: whether blocking is enabled by default.)r@   r3   r!   s   &r   r3   ÚAsyncReadWriteLock.blockingU   s   € ð �z‰z×"Ñ"Ð"r   c               ó   € V ^8„  d   QhRR/# )r   r   r<   r   )r   s   "r   r   r=   [   s   € ÷ ñ Ð6ñ r   c                ó   € V P                   # )z<:returns: the event loop (or ``None`` for the running loop).)rA   r!   s   &r   r5   ÚAsyncReadWriteLock.loopZ   s   € ð �z‰zÐr   c               ó   € V ^8„  d   QhRR/# )r   r   zfutures.Executorr   )r   s   "r   r   r=   `   s   € ÷ ñ Ð*ñ r   c                ó   € V P                   # )zi:returns: the executor used for ``run_in_executor`` (a dedicated single-thread one if none was supplied).)rC   r!   s   &r   r6   ÚAsyncReadWriteLock.executor_   s   € ð �~‰~Ðr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   ÚfunczCallable[..., object]ÚargsÚobjectÚkwargsr   r   )r   s   "r   r   r=   d   s0   € ÷ dñ dÐ4ð d¸Vð dÈvð dÐZ`ñ dr   c              �  	óØ   "  € V P                   ;'       g    \        P                  ! 4       pVP                  V P                  \
        P                  ! V.VO5/ VB 4      G R j  x€L
 #  L5ir   )rA   ÚasyncioÚget_running_loopÚrun_in_executorrC   Ú	functoolsÚpartial)r   rV   rW   rY   r5   s   &&*, r   Ú_runÚAsyncReadWriteLock._rund   sS   é € Ø�z‰z×7Ð7œW×5Ò5Ó7ˆØ×)Ñ)¨$¯.©.¼)×:KÒ:KÈDÐ:bÐSWÒ:bÐ[aÑ:bÓc×cÐcÑcùs   ‚A!A*Á#A(Á$A*c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r9   r:   r3   r;   r   r   r   )r   s   "r   r   r=   h   s"   € ÷ ;ñ ;¨%ð ;À4ð ;ÐSsñ ;r   c             ƒ  ó„   "  € V P                  V P                  P                  WR7      G Rj  x€L
  \        V R7      #  L5i)a÷  
Acquire a shared read lock.

See :meth:`ReadWriteLock.acquire_read` for full semantics.

:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable

:returns: a proxy that can be used as an async context manager to release the lock

:raises RuntimeError: if a write lock is already held on this instance
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

©r3   Nr   )r`   r@   Úacquire_readr   ©r   r9   r3   s   &&$r   rf   ÚAsyncReadWriteLock.acquire_readh   s8   é € ð �i‰i˜Ÿ
™
×/Ñ/°ˆiÓL×LÐLÜ/°TÔ:Ð:ñ 	Mùó   ‚+A ­>®A c               ó$   € V ^8„  d   QhRRRRRR/# rc   r   )r   s   "r   r   r=   z   s"   € ÷ ;ñ ;¨5ð ;ÀDð ;ÐTtñ ;r   c             ƒ  ó„   "  € V P                  V P                  P                  WR7      G Rj  x€L
  \        V R7      #  L5i)a  
Acquire an exclusive write lock.

See :meth:`ReadWriteLock.acquire_write` for full semantics.

:param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately when the lock is unavailable

:returns: a proxy that can be used as an async context manager to release the lock

:raises RuntimeError: if a read lock is already held, or a write lock is held by a different thread
:raises Timeout: if the lock cannot be acquired within *timeout* seconds

re   Nr   )r`   r@   Úacquire_writer   rg   s   &&$r   rl   Ú AsyncReadWriteLock.acquire_writez   s8   é € ð �i‰i˜Ÿ
™
×0Ñ0°'ˆiÓM×MÐMÜ/°TÔ:Ð:ñ 	Nùri   ÚforceFc               ó    € V ^8„  d   QhRRRR/# )r   rn   r;   r   r   r   )r   s   "r   r   r=   Œ   s   € ÷ 9ñ 9 dð 9°tñ 9r   c             ƒ  óp   "  € V P                  V P                  P                  VR7      G Rj  x€L
  R#  L5i)a
  
Release one level of the current lock.

See :meth:`ReadWriteLock.release` for full semantics.

:param force: if ``True``, release the lock completely regardless of the current lock level

:raises RuntimeError: if no lock is currently held and *force* is ``False``

)rn   N)r`   r@   r)   )r   rn   s   &$r   r)   ÚAsyncReadWriteLock.releaseŒ   s'   é € ð �i‰i˜Ÿ
™
×*Ñ*°%ˆiÓ8×8Ô8ùs   ‚+6­4®6c               ó$   € V ^8„  d   QhRRRRRR/# ©r   r9   zfloat | Noner3   zbool | Noner   zAsyncGenerator[None]r   )r   s   "r   r   r=   š   s"   € ÷ !ñ ! |ð !Èð !Ð`tñ !r   c              ó*  "  € Vf   V P                   P                  pVf   V P                   P                  pV P                  WR7      G Rj  x€L
   R5x € V P	                  4       G Rj  x€L
  R#  L$ L  T P	                  4       G Rj  x€L 
  i ; i5i)a[  
Async context manager that acquires and releases a shared read lock.

Falls back to instance defaults for *timeout* and *blocking* when ``None``.

:param timeout: maximum wait time in seconds, or ``None`` to use the instance default
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default

Nre   )r@   r9   r3   rf   r)   rg   s   &&$r   Ú	read_lockÚAsyncReadWriteLock.read_lock™   sw   é € ð Š?Ø—j‘j×(Ñ(ˆGØÒØ—z‘z×*Ñ*ˆHØ×Ñ ÐÓ;×;Ð;ð	!Üà—,‘,“.× Ò ñ	 	<ñ !ø�$—,‘,“.× Ò üóH   ‚A
BÁA1ÁBÁA5 ÁBÁ*A3Á+BÁ3BÁ5BÂ	BÂ
BÂBc               ó$   € V ^8„  d   QhRRRRRR/# rs   r   )r   s   "r   r   r=   ¯   s"   € ÷ !ñ !¨ð !È+ð !Ðauñ !r   c              ó*  "  € Vf   V P                   P                  pVf   V P                   P                  pV P                  WR7      G Rj  x€L
   R5x € V P	                  4       G Rj  x€L
  R#  L$ L  T P	                  4       G Rj  x€L 
  i ; i5i)a`  
Async context manager that acquires and releases an exclusive write lock.

Falls back to instance defaults for *timeout* and *blocking* when ``None``.

:param timeout: maximum wait time in seconds, or ``None`` to use the instance default
:param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately; ``None`` uses the instance default

Nre   )r@   r9   r3   rl   r)   rg   s   &&$r   Ú
write_lockÚAsyncReadWriteLock.write_lock®   sw   é € ð Š?Ø—j‘j×(Ñ(ˆGØÒØ—z‘z×*Ñ*ˆHØ× Ñ  Ð Ó<×<Ð<ð	!Üà—,‘,“.× Ò ñ	 	=ñ !ø�$—,‘,“.× Ò ürw   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r=   Ã   s   € ÷ 	0ñ 	0˜Tñ 	0r   c              ƒ  óÌ   "  € V P                  V P                  P                  4      G Rj  x€L
  V P                  '       d   V P                  P                  RR7       R# R#  L65i)zŒ
Release the lock (if held) and close the underlying SQLite connection.

After calling this method, the lock instance is no longer usable.

NF©Úwait)r`   r@   ÚcloserB   rC   Úshutdownr!   s   &r   r�   ÚAsyncReadWriteLock.closeÃ   sN   é € ð �i‰i˜Ÿ
™
×(Ñ(Ó)×)Ð)Ø××ÐØ�N‰N×#Ñ#¨Ð#Ö/ñ ñ 	*ùs   ‚)A$«A"¬A$Á!A$c               ó   € V ^8„  d   QhRR/# r}   r   )r   s   "r   r   r=   Î   s   € ÷ 0ñ 0˜ñ 0r   c                	óh   € \        V R R4      '       d   V P                  P                  RR7       R# R# )rB   Fr   N)ÚgetattrrC   r‚   r!   s   &r   Ú__del__ÚAsyncReadWriteLock.__del__Î   s.   € ô �4Ð)¨5×1Ò1Ø�N‰N×#Ñ#¨Ð#Ö/ñ 2r   )rC   r@   rA   rB   )éÿÿÿÿr   )r,   r-   r.   r/   r0   r   Úpropertyr8   r9   r3   r5   r6   r`   rf   rl   r)   r   ru   rz   r�   r‡   r1   r   r   r   r   r   &   s  † ññ*Gð
 ðGð "ðGð 26ðGð -1÷Gð Gð ô$ó ð$ð ô"ó ð"ð ô#ó ð#ð ôó ðð ôó ðõdñ;È$÷ ;ð ;ñ$;È4÷ ;ð ;ð$9¨U÷ 9ð ñ!ÐW[÷ !ó ð!ð( ñ!ÐX\÷ !ó ð!õ(	0÷0ñ 0r   r   )r0   Ú
__future__r   r[   r^   Úconcurrent.futuresr   Ú
contextlibr   Útypingr   Ú_read_writer   ÚosÚcollections.abcr   r   Ú
concurrentr	   Útypesr
   r   r   Ú__all__r   r   r   Ú<module>r•      sR   ðÙ Kå "ã Û Ý 1Ý *Ý  å &çÛß8Ý"Ý#÷"ñ "÷$l0ñ l0ð` 'Øð‚r   