§
    dŠtjÁ¨  ã                  ó(  — U d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlmZmZmZ ddlmZ ddlmZ ddlmZmZmZ ddlmZ dd	lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ dd
l%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z, erddl-m.Z.m/Z/ ed         Z0dZ1de2d<   dZ3de2d<    e4edd¦  «        Z5de2d<    e4edd¦  «        Z6de2d<   e
j7        dk    oej8        ej9        v Z:de2d<    e¦   «         Z;de2d<    ej<        ¦   «         a=de2d<    e>¦   «         Z?d e2d!<    G d"„ d#e@¦  «        ZA G d$„ d%eA¬&¦  «        ZB G d'„ d(ejC        ¦  «        ZDdd)œdTd0„ZEdUd4„ZFdd)œdVd5„ZGdd)œdWd6„ZHdXd9„ZIdd)œdYd;„ZJdd)œdZd@„ZKdd)œd[dB„ZLd\dE„ZMd]dG„ZNd^dH„ZO edI¬J¦  «         G dK„ dL¦  «        ¦   «         ZPe G dM„ dN¦  «        ¦   «         ZQ edI¬J¦  «         G dO„ dP¦  «        ¦   «         ZRe G dQ„ dR¦  «        ¦   «         ZSd_dS„ZT ejU        eT¦  «          e!eB¦  «         d%gZVdS )`zZCross-process and cross-host reader/writer lock built on :class:`SoftFileLock` primitives.é    )ÚannotationsN)ÚclosingÚcontextmanagerÚsuppress)Ú	dataclass)ÚPath)ÚTYPE_CHECKINGÚFinalÚLiteral)ÚWeakValueDictionary)ÚAcquireReturnProxyÚ_ensure_current_processÚ_fork_transitionÚ_raise_grouped_errorsÚ_register_fork_classÚ_register_fork_objectÚ_register_owned_descriptorÚ_unregister_owned_descriptor)ÚTimeout)ÚSoftFileLock)Úensure_directory_existsÚtouchÚ	write_all)ÚCallableÚ	Generator)ÚreadÚwritez.breakz
Final[str]Ú_BREAK_SUFFIXi   z
Final[int]Ú_MAX_MARKER_SIZEÚ
O_NOFOLLOWÚ_O_NOFOLLOWÚ
O_NONBLOCKÚ_O_NONBLOCKÚwin32zFinal[bool]Ú_SUPPORTS_DIR_FDz2Final[WeakValueDictionary[int, SoftReadWriteLock]]Ú_ALL_INSTANCESúthreading.LockÚ_ALL_INSTANCES_LOCKzFinal[set[Path]]Ú_SINGLETONS_UNDER_CONSTRUCTIONc                  óH   ‡ — e Zd ZU ded<   ded<   	 dddddd	d
œdˆ fd„Zˆ xZS )Ú_SoftRWMetaú,WeakValueDictionary[Path, SoftReadWriteLock]Ú
_instanceszthreading.RLockÚ_instances_lockéÿÿÿÿTç      >@Nç      Ð?©ÚblockingÚis_singletonÚheartbeat_intervalÚstale_thresholdÚpoll_intervalÚ	lock_fileústr | os.PathLike[str]ÚtimeoutÚfloatr3   Úboolr4   r5   r6   úfloat | Noner7   ÚreturnÚSoftReadWriteLockc          
     ón  •— t          ¦   «          |s(t          ¦   «                              |||||||¬¦  «        S t          |¦  «                             ¦   «         }| j        5  | j                             |¦  «        }	|	€à|t          v rd|›�}
t          |
¦  «        ‚t          j        ¦   «         }t                               |¦  «         	 t          ¦   «                              |||||||¬¦  «        }	t                               |¦  «         n# t                               |¦  «         w xY wt          j        ¦   «         |k    rd}
t          |
¦  «        ‚|	| j        |<   n=|	j        |k    s|	j        |k    r'd|	j        › d|	j        › d|› d|› �}
t!          |
¦  «        ‚|	cd d d ¦  «         S # 1 swxY w Y   d S )Nr2   z2Singleton lock construction is already active for zOLock construction cannot continue after fork; construct a new lock in the childz$Singleton lock created with timeout=z, blocking=z, cannot be changed to timeout=)r   ÚsuperÚ__call__r   Úresolver.   r-   Úgetr)   ÚRuntimeErrorÚosÚgetpidÚaddÚdiscardr:   r3   Ú
ValueError)Úclsr8   r:   r3   r4   r5   r6   r7   Ú
normalizedÚinstanceÚmsgÚconstruction_pidÚ	__class__s               €úU/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/filelock/_soft_rw/_sync.pyrB   z_SoftRWMeta.__call__:   sP  ø€ õ 	 Ñ!Ô!Ð!Øð 		Ý‘7”7×#Ò#ØØØ!Ø)Ø#5Ø /Ø+ð $ñ ô ð õ ˜)‘_”_×,Ò,Ñ.Ô.ˆ
ØÔ ð 	ð 	Ø”~×)Ò)¨*Ñ5Ô5ˆHØÐØÕ!?Ð?Ð?Ø\ÈyÐ\Ð\�CÝ& sÑ+Ô+Ð+Ý#%¤9¡;¤;Ð Ý.×2Ò2°:Ñ>Ô>Ð>ðGÝ$™wœw×/Ò/Ø!ØØ!)Ø%1Ø+=Ø(7Ø&3ð  0ñ  ô  �Hõ 3×:Ò:¸:ÑFÔFÐFÐFøÕ2×:Ò:¸:ÑFÔFÐFÐFøøøÝ”9‘;”;Ð"2Ò2Ð2Øk�CÝ& sÑ+Ô+Ð+Ø-5�”˜zÑ*Ð*ØÔ! WÒ,Ð,°Ô0AÀXÒ0MÐ0MðT¸8Ô;Kð Tð TÐX`ÔXið Tð TØ5<ðTð TØIQðTð Tð õ ! ‘o”oÐ%Øð=	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	s,   Á"A'F*Ã
(DÃ2F*ÄD)Ä)A4F*Æ*F.Æ1F.©r/   )r8   r9   r:   r;   r3   r<   r4   r<   r5   r;   r6   r=   r7   r;   r>   r?   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__rB   Ú__classcell__©rP   s   @rQ   r+   r+   6   s|   ø€ € € € € € Ø<Ð<Ð<Ñ<Ø$Ð$Ð$Ñ$ð
 ð6ð
 Ø!Ø$(Ø(,Ø#ð6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ð 6ó    r+   c                  ó’  — e Zd ZU dZ e¦   «         Zded<    ej        ¦   «         Z		 dBdddddd	œdCd„Z
edDd„¦   «         ZedEddœdFd„¦   «         ZedEddœdFd„¦   «         ZdEddœdGd„ZdEddœdGd „Ze	 dBddœdHd!„¦   «         ZdDd"„Zd#d$œdId&„ZdJd)„ZdKd,„ZdLd/„ZdMd0„ZdNd3„ZdOd4„ZdOd5„ZdNd6„ZdPd9„ZdDd:„ZdQd;„ZdRd=„Z dSd?„Z!dQd@„Z"dDdA„Z#dS )Tr?   u°
  
    Cross-process and cross-host reader/writer lock built on :class:`SoftFileLock` primitives.

    Use this class instead of :class:`~filelock.ReadWriteLock` when the lock file lives on a network
    filesystem (NFS, Lustre with ``-o flock``, HPC cluster shared storage). ``ReadWriteLock`` is backed
    by SQLite and cannot run on NFS because SQLite's ``fcntl`` locking is unreliable there.

    Layout on disk for a lock at ``foo.lock``:

    - ``foo.lock.state`` â€” a :class:`SoftFileLock` taken only during state transitions (microseconds).
    - ``foo.lock.write`` â€” writer marker; its presence means a writer is claiming or holding the lock.
    - ``foo.lock.readers/<host>.<pid>.<uuid>`` â€” one file per reader.

    Each marker stores a random token (``secrets.token_hex(16)``), the holder's pid, and the holder's
    hostname. A daemon heartbeat thread refreshes ``mtime`` on every held marker. A marker whose mtime
    has not advanced in ``stale_threshold`` seconds may be evicted by any process on any host, giving
    correct behavior when a compute node crashes with a lock held.

    Writer acquire is two-phase and writer-preferring: phase 1 claims ``.write`` (blocking any new
    reader), phase 2 waits for existing readers to drain. Writer starvation is impossible.

    Reentrancy, upgrade/downgrade rules, thread pinning, and singleton caching by resolved path match
    :class:`~filelock.ReadWriteLock`.

    Forking invalidates the inherited instance in the child so the child cannot double-own the lock with its parent;
    ``release()`` on that instance is a no-op, and the child must construct a new instance if it needs a lock.

    Trust boundary: protects against same-UID non-cooperating processes (one host or cross-host) and
    same-host different-UID users via ``0o600`` / ``0o700`` permissions. Does not protect against root
    compromise, NTP tampering on same-UID cross-host nodes, or multi-tenant mounts where hostile
    co-tenants share the UID.

    :param lock_file: path to the lock file; sidecar state/write/readers live next to it
    :param timeout: maximum wait time in seconds; ``-1`` means block indefinitely
    :param blocking: if ``False``, raise :class:`~filelock.Timeout` immediately on contention
    :param is_singleton: if ``True``, reuse existing instances for the same resolved path
    :param heartbeat_interval: seconds between heartbeat refreshes; default 30 s
    :param stale_threshold: seconds of ``mtime`` inactivity before a marker is stale; defaults to
        ``3 * heartbeat_interval``, matching etcd's ``LeaseKeepAlive`` convention
    :param poll_interval: seconds between acquire retries under contention; default 0.25 s

    .. versionadded:: 3.27.0

    r,   r-   r/   Tr0   Nr1   r2   r8   r9   r:   r;   r3   r<   r4   r5   r6   r=   r7   r>   ÚNonec               óL  — t          j        ¦   «         | _        |dk    rd|› �}t          |¦  «        ‚|€|dz  }||k    rd|› d|› d�}t          |¦  «        ‚|dk    rd|› �}t          |¦  «        ‚t          j        |¦  «        | _        || _        || _        || _        || _	        || _
        t          | j        › d�| j        › d	�| j        › d
�¬¦  «        | _        t          | j        ¦  «         t          t          j        ¦   «         t          j        ¦   «         t#          | j        j        d¬¦  «        ¬¦  «        | _        d | _        d | _        d | _        d| _        t0          5  | t2          t5          | ¦  «        <   d d d ¦  «         n# 1 swxY w Y   t7          | ¦  «         d S )Nr   z)heartbeat_interval must be positive, got é   z0stale_threshold must exceed heartbeat_interval (z <= ú)z$poll_interval must be positive, got z.statez.writez.readers)Ústater   Úreadersr/   ©r:   ©ÚinternalÚtransactionr_   F)rF   rG   Ú_creator_pidrJ   Úfspathr8   r:   r3   r5   r6   r7   Ú_PathsÚ_pathsr   Ú_LocksÚ	threadingÚLockr   r_   Ú_locksÚ_readers_dir_fdÚ_readers_dir_fd_tokenÚ_holdÚ_closedr(   r&   Úidr   )	Úselfr8   r:   r3   r4   r5   r6   r7   rN   s	            rQ   Ú__init__zSoftReadWriteLock.__init__¤   s  € õ œI™KœKˆÔØ Ò"Ð"ØRÐ>PÐRÐRˆCÝ˜S‘/”/Ð!ØÐ"Ø0°1Ñ4ˆOØÐ0Ò0Ð0ØoÀ_ÐoÐoÐZlÐoÐoÐoˆCÝ˜S‘/”/Ð!Ø˜AÒÐØH¸ÐHÐHˆCÝ˜S‘/”/Ð!å œi¨	Ñ2Ô2ˆŒØ%ˆŒØ&ˆŒØ);ˆÔØ&5ˆÔØ$1ˆÔåØ”^Ð+Ð+Ð+Ø”^Ð+Ð+Ð+Ø”~Ð/Ð/Ð/ð
ñ 
ô 
ˆŒõ
 	  ¤Ñ/Ô/Ð/ÝÝ”^Ñ%Ô%Ý!œÑ(Ô(Ý˜tœ{Ô0¸"Ð=Ñ=Ô=ð
ñ 
ô 
ˆŒð
 ,0ˆÔØ15ˆÔ"Ø#'ˆŒ
Ø"ˆŒå ð 	,ð 	,Ø'+�N�2˜d™8œ8Ñ$ð	,ð 	,ð 	,ñ 	,ô 	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,øøøð 	,ð 	,ð 	,ð 	,å˜dÑ#Ô#Ð#Ð#Ð#s   Å&F
Æ
FÆFc                ó´   — t          j        ¦   «         at          ¦   «         | _        t          j        ¦   «         | _        t                               ¦   «          d S ©N)	rj   rk   r(   r   r-   ÚRLockr.   r)   Úclear)rK   s    rQ   Ú_reset_class_after_forkz)SoftReadWriteLock._reset_class_after_fork×   sG   € õ (œnÑ.Ô.ÐÝ,Ñ.Ô.ˆŒÝ'œoÑ/Ô/ˆÔÝ&×,Ò,Ñ.Ô.Ð.Ð.Ð.rY   ©r3   úbool | NoneúGenerator[None]c             #  óœ   K  — |                       ||¬¦  «         	 dV — |                      ¦   «          dS # |                      ¦   «          w xY w)a  
        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

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

        ry   N)Úacquire_readÚrelease©rr   r:   r3   s      rQ   Ú	read_lockzSoftReadWriteLock.read_lockß   sR   è è € ð 	×Ò˜'¨HÐÑ5Ô5Ð5ð	ØˆEˆEˆEà�LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøøó	   ›5 µAc             #  óœ   K  — |                       ||¬¦  «         	 dV — |                      ¦   «          dS # |                      ¦   «          w xY w)a@  
        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

        :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

        ry   N)Úacquire_writer~   r   s      rQ   Ú
write_lockzSoftReadWriteLock.write_lockó   sR   è è € ð 	×Ò˜7¨XÐÑ6Ô6Ð6ð	ØˆEˆEˆEà�LŠL‰NŒNˆNˆNˆNøˆD�LŠL‰NŒNˆNˆNøøør�   r   c               ó2   — |                       d||¬¦  «        S )uf  
        Acquire a shared read lock.

        If this instance already holds a read lock, the lock level is incremented (reentrant). Attempting to acquire a
        read lock while holding a write lock raises :class:`RuntimeError` (downgrade not allowed). On the 0â†’1
        transition a daemon heartbeat thread is started that refreshes the reader marker's ``mtime`` every
        ``heartbeat_interval`` seconds so peers on other hosts do not evict the marker as stale.

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

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

        :raises RuntimeError: if a write lock is already held on this instance, if this instance was invalidated by
            :func:`os.fork`, or if :meth:`close` was called
        :raises Timeout: if the lock cannot be acquired within *timeout* seconds

        r   ry   ©Ú_acquirer   s      rQ   r}   zSoftReadWriteLock.acquire_read  s   € ð* �}Š}˜V W°xˆ}Ñ@Ô@Ð@rY   c               ó2   — |                       d||¬¦  «        S )a¨  
        Acquire an exclusive write lock.

        If this instance already holds a write lock from the same thread, the lock level is incremented (reentrant).
        Attempting to acquire a write lock while holding a read lock raises :class:`RuntimeError` (upgrade not
        allowed). Write locks are pinned to the acquiring thread: a different thread trying to re-enter also raises
        :class:`RuntimeError`.

        Writer acquisition runs in two phases. Phase 1 atomically claims ``<path>.write`` via ``O_CREAT | O_EXCL``,
        which immediately blocks any new reader on any host. Phase 2 waits for existing readers to drain. Writer
        starvation is impossible: new readers see ``<path>.write`` during phase 2 and wait behind the pending writer.

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

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

        :raises RuntimeError: if a read lock is already held, if a write lock is held by a different thread, if this
            instance was invalidated by :func:`os.fork`, or if :meth:`close` was called
        :raises Timeout: if the lock cannot be acquired within *timeout* seconds

        r   ry   r†   r   s      rQ   rƒ   zSoftReadWriteLock.acquire_write  s   € ð2 �}Š}˜W g¸ˆ}ÑAÔAÐArY   c               ó   —  | |||¬¦  «        S )a  
        Return the singleton :class:`SoftReadWriteLock` for *lock_file*.

        :param lock_file: path to the lock file; sidecar state/write/readers live next to it
        :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: the singleton lock instance

        :raises ValueError: if an instance already exists for this path with different *timeout* or *blocking* values

        ry   © )rK   r8   r:   r3   s       rQ   Úget_lockzSoftReadWriteLock.get_lock9  s   € ð( ˆs�9˜g°Ð9Ñ9Ô9Ð9rY   c                ó,  — | j         t          j        ¦   «         k    rdS |                      d¬¦  «         | j        j        5  | j        r	 ddd¦  «         dS d| _        | j        �—t          ¦   «         5  | j	        �t          | j	        ¦  «         d| _	        | j        dc}| _        t          t          ¦  «        5  t          j        |¦  «         ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS )u  
        Release any held lock and release internal filesystem resources.

        Idempotent. After calling this method the instance can no longer acquire locks â€” subsequent acquires raise
        :class:`RuntimeError`. A fork-invalidated instance is closed without raising.
        NT©Úforce)re   rF   rG   r~   rl   rc   rp   rm   r   rn   r   r   ÚOSErrorÚclose)rr   Úfds     rQ   r�   zSoftReadWriteLock.closeO  sì  € ð Ô¥¤	¡¤Ò+Ð+ØˆFØ�Š˜4ˆÑ Ô Ð ØŒ[Ô!ð 	%ð 	%ØŒ|ð Øð	%ð 	%ð 	%ñ 	%ô 	%ð 	%ð 	%ð 	%ð  ˆDŒLØÔ#Ð/Ý%Ñ'Ô'ð %ð %ØÔ1Ð=Ý4°TÔ5OÑPÔPÐPØ15�DÔ.Ø/3Ô/CÀTÐ,�B˜Ô,Ý!¥'Ñ*Ô*ð %ð %Ýœ ™œ˜ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ð	%ð 	%ð 	%ñ 	%ô 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%øøøð 	%ð 	%ð 	%ð 	%ð 	%ð 	%sa   Á	D	ÁD	Á3AC1Â9CÃC1ÃCÃC1Ã!CÃ"C1Ã%D	Ã1C5	Ã5D	Ã8C5	Ã9D	Ä	DÄDFr�   rŽ   c               óx  — | j         t          j        ¦   «         k    rdS | j        j        5  | j        }|€:|r	 ddd¦  «         dS d| j        › dt          | ¦  «        › d�}t          |¦  «        ‚|rd|_	        n|xj	        dz  c_	        |j	        dk    r	 ddd¦  «         dS d| _        ddd¦  «         n# 1 swxY w Y   |j
                             ¦   «          |j                             | j        dz   ¬¦  «         |j        rt!          |j        | j        ¬	¦  «         dS |                      |j        ¦  «         dS )
a8  
        Release one level of the current lock.

        When the lock level reaches zero the heartbeat thread is stopped and the held marker file is unlinked. On a
        fork-invalidated instance (that is, the child of a :func:`os.fork` call made while the parent held a lock)
        this method is a no-op so inherited ``with`` blocks can unwind cleanly in the child.

        :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``

        NzCannot release a lock on ú (lock id: z) that is not heldr   é   g      ð?ra   ©Údir_fd)re   rF   rG   rl   rc   ro   r8   rq   rE   ÚlevelÚheartbeat_stopÚsetÚheartbeat_threadÚjoinr5   Ú	is_readerÚ_unlinkÚmarker_namerm   Ú_unlink_writer_marker_if_oursÚtoken)rr   rŽ   ÚholdrN   s       rQ   r~   zSoftReadWriteLock.releasef  sË  € ð Ô¥¤	¡¤Ò+Ð+ØˆFØŒ[Ô!ð 	ð 	Ø”:ˆDØˆ|Øð Øð		ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð
 j°$´.ÐiÐiÍRÐPTÉXÌXÐiÐiÐi�Ý" 3Ñ'Ô'Ð'Øð  Ø�”
�
à�
”
˜a‘�
”
ØŒz˜AŠ~ˆ~Øð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð ˆDŒJð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð" 	Ô×ÒÑ!Ô!Ð!ØÔ×"Ò"¨4Ô+BÀSÑ+HÐ"ÑIÔIÐIØŒ>ð 	;Ý�DÔ$¨TÔ-AÐBÑBÔBÐBÐBÐBà×.Ò.¨t¬zÑ:Ô:Ð:Ð:Ð:s   «B5ÁAB5Â"B5Â5B9Â<B9r    Ústrc                ó2  — | j         j        5  t          | j        j        ¦  «        x}€	 d d d ¦  «         d S |\  }}|�t          j        |j        |¦  «        s	 d d d ¦  «         d S t          | j        j        ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S ru   )	rl   r_   Ú_read_markerrh   r   ÚhmacÚcompare_digestr    r�   )rr   r    r   ÚinfoÚ_s        rQ   rŸ   z/SoftReadWriteLock._unlink_writer_marker_if_ours�  s  € ð Œ[Ôð 	'ð 	'Ý$ T¤[Ô%6Ñ7Ô7Ð7�Ð@Øð	'ð 	'ð 	'ñ 	'ô 	'ð 	'ð 	'ð 	'ð ‰GˆD�!Øˆ|¥4Ô#6°t´zÀ5Ñ#IÔ#Iˆ|Øð	'ð 	'ð 	'ñ 	'ô 	'ð 	'ð 	'ð 	'õ �D”KÔ%Ñ&Ô&Ð&ð	'ð 	'ð 	'ñ 	'ô 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'øøøð 	'ð 	'ð 	'ð 	'ð 	'ð 	's   �B·"BÁ&BÂBÂBÚmodeÚ_Modec               óV  — | j         t          j        ¦   «         k    rd| j        › d�}t	          |¦  «        ‚|€| j        n|}|€| j        n|}| j        j        5  | j	        rd| j        › d�}t	          |¦  «        ‚| j
        �!|                      |¦  «        cd d d ¦  «         S 	 d d d ¦  «         n# 1 swxY w Y   t          j        ¦   «         }|s!| j        j                             d¬¦  «        }nH|dk    r!| j        j                             d¬¦  «        }n!| j        j                             d|¬¦  «        }|st!          | j        ¦  «        d ‚	 |                      ||||¬¦  «        | j        j                             ¦   «          S # | j        j                             ¦   «          w xY w)	NzSoftReadWriteLock on z4 was invalidated by fork(); construct a new instancez has been closedFry   r/   T)r3   r:   )re   rF   rG   r8   rE   r:   r3   rl   rc   rp   ro   Ú_validate_reentrantÚtimeÚperf_counterrd   Úacquirer   Ú_do_acquire_innerr~   )rr   r©   r:   r3   rN   ÚstartÚacquireds          rQ   r‡   zSoftReadWriteLock._acquireœ  s  € ð Ô¥¤	¡¤Ò+Ð+Øn¨$¬.ÐnÐnÐnˆCÝ˜sÑ#Ô#Ð#Ø") /�$”,�,°wˆØ$,Ð$4�4”=�=¸(ˆàŒ[Ô!ð 	6ð 	6ØŒ|ð (ØN¨d¬nÐNÐNÐN�Ý" 3Ñ'Ô'Ð'ØŒzÐ%Ø×/Ò/°Ñ5Ô5ð	6ð 	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð &ð		6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6øøøð 	6ð 	6ð 	6ð 	6õ Ô!Ñ#Ô#ˆØð 	WØ”{Ô.×6Ò6ÀÐ6ÑFÔFˆHˆHØ˜Š]ˆ]Ø”{Ô.×6Ò6ÀÐ6ÑEÔEˆHˆHà”{Ô.×6Ò6ÀÈgÐ6ÑVÔVˆHØð 	4Ý˜$œ.Ñ)Ô)¨tÐ3ð	.Ø×)Ò)¨$°¸ÈÐ)ÑRÔRàŒKÔ#×+Ò+Ñ-Ô-Ð-Ð-øˆDŒKÔ#×+Ò+Ñ-Ô-Ð-Ð-øøøs   Á=B0Â0B4Â7B4ÅF Æ F(Úeffective_timeoutr±   c               ó€  — | j         j        5  | j        �!|                      |¦  «        cd d d ¦  «         S 	 d d d ¦  «         n# 1 swxY w Y   |dk    rd n||z   }t	          j        d¦  «        }|dk    r|                      |||¬¦  «        \  }}n|                      |||¬¦  «        \  }}t          j	        ¦   «         }	t          | j        | j        |	dt          | ¦  «        d›�¬¦  «        }
d }| j         j        5  t          d||dk    rt          j        ¦   «         nd ||||
|	¬	¦  «        | _        	 |
                     ¦   «          n # t"          $ r}d | _        |}Y d }~nd }~ww xY wd d d ¦  «         n# 1 swxY w Y   |�0|rt%          || j        ¬
¦  «         n|                      |¦  «         |‚t+          | ¬¦  «        S )Nr/   é   r   ©Údeadliner3   zfilelock-heartbeat-Úx)ÚrefreshÚintervalÚ
stop_eventÚnamer”   )r—   r©   Úwrite_thread_idrž   rœ   r    rš   r˜   r•   ©Úlock)rl   rc   ro   r¬   ÚsecretsÚ	token_hexÚ_acquire_writer_slotÚ_acquire_reader_slotrj   ÚEventÚ_HeartbeatThreadÚ_refresh_markerr5   rq   Ú_HoldÚ	get_identr±   ÚBaseExceptionr�   rm   rŸ   r   )rr   r©   r³   r±   r3   r·   r    rž   rœ   r»   Ú	heartbeatÚstart_errorÚerrors                rQ   r°   z#SoftReadWriteLock._do_acquire_inner¾  s®  € ð Œ[Ô!ð 	6ð 	6ØŒzÐ%Ø×/Ò/°Ñ5Ô5ð	6ð 	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6Ø%ð	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6øøøð 	6ð 	6ð 	6ð 	6ð -°Ò2Ð2�4�4¸Ð@QÑ8QˆÝÔ! "Ñ%Ô%ˆØ�7Š?ˆ?Ø%)×%>Ò%>¸uÈxÐbjÐ%>Ñ%kÔ%kÑ"ˆK˜˜à%)×%>Ò%>¸uÈxÐbjÐ%>Ñ%kÔ%kÑ"ˆK˜Ý”_Ñ&Ô&ˆ
Ý$ØÔ(ØÔ,Ø!Ø3¥r¨$¡x¤xÐ3Ð3Ð3ð	
ñ 
ô 
ˆ	ð -1ˆØŒ[Ô!ð 	$ð 	$ÝØØØ9=Àº¸¥	Ô 3Ñ 5Ô 5Ð 5ÈdØ'Ø#ØØ!*Ø)ð	ñ 	ô 	ˆDŒJð$Ø—’Ñ!Ô!Ð!Ð!øÝ ð $ð $ð $Ø!�”
Ø#������øøøøð$øøøð	$ð 	$ð 	$ñ 	$ô 	$ð 	$ð 	$ð 	$ð 	$ð 	$ð 	$øøøð 	$ð 	$ð 	$ð 	$ð  Ð"Øð :Ý˜¨DÔ,@ÐAÑAÔAÐAÐAà×2Ò2°5Ñ9Ô9Ð9ØÐÝ! tÐ,Ñ,Ô,Ð,sM   �AÁAÁ
AÃ;6E3Ä2EÅE3Å
E$Å	EÅE3ÅE$Å$E3Å3E7Å:E7c                ó¬  — | j         }|€J ‚|j        |k    rG|dk    rdnd}|dk    rdnd}d|› d| j        › dt          | ¦  «        › d|› d	|› d
�}t	          |¦  «        ‚|dk    rRt          j        ¦   «         x}|j        k    r4d| j        › dt          | ¦  «        › d|› d|j        › �}t	          |¦  «        ‚|xj        dz  c_        t          | ¬¦  «        S )Nr   r   Ú	downgradeÚupgradezCannot acquire z	 lock on r“   z): already holding a z lock (z not allowed)zCannot acquire write lock on z) from thread z while it is held by thread r”   r¾   )
ro   r©   r8   rq   rE   rj   rÈ   r½   r—   r   )rr   r©   r¡   ÚoppositeÚ	directionrN   Úcurs          rQ   r¬   z%SoftReadWriteLock._validate_reentrantó  sY  € ØŒzˆØÐÐÐØŒ9˜ÒÐØ"&¨&¢. .�w�w°fˆHØ'+¨v¢~ ~˜˜¸9ˆIðO $ð Oð O°´ð Oð OÍBÈtÉHÌHð Oð OØ%-ðOð OØ6?ðOð Oð Oð õ ˜sÑ#Ô#Ð#Ø�7Š?ˆ?¥yÔ':Ñ'<Ô'<Ð < ÀÔAUÒUÐUðW°´ð Wð WÍ2ÈdÉ8Ì8ð Wð WØ"ðWð WØ@DÔ@TðWð Wð õ ˜sÑ#Ô#Ð#Øˆ
Œ
�a‰ˆ
Œ
Ý! tÐ,Ñ,Ô,Ð,rY   r·   útuple[str, bool]c               ó  ‡ ‡— ‰                       ¦   «          dˆ ˆfd„}dˆ ˆfd„}‰                      |||¬¦  «         	 ‰                      |||¬¦  «         n$# t          $ r ‰                      ‰¦  «         ‚ w xY w‰ j        j        dfS )Nr>   r<   c                 óz   •— ‰ j         j        5  ‰                      ‰¦  «        cd d d ¦  «         S # 1 swxY w Y   d S ru   )rl   r_   Ú_claim_writer_marker©rr   r    s   €€rQ   Útry_claim_writerz@SoftReadWriteLock._acquire_writer_slot.<locals>.try_claim_writer  sƒ   ø€ Ø”Ô"ð 8ð 8Ø×0Ò0°Ñ7Ô7ð8ð 8ð 8ð 8ñ 8ô 8ð 8ð 8ð 8ð 8ð 8ð 8øøøð 8ð 8ð 8ð 8ð 8ð 8s   Ž0°4·4c                 ó6  •— ‰ j         j        5  ‰                      ‰¦  «        s#‰                      ‰¦  «        s	 d d d ¦  «         dS ‰                      t          j        ¦   «         ¦  «         ‰                      ¦   «          cd d d ¦  «         S # 1 swxY w Y   d S ©NF)rl   r_   Ú_touch_writer_marker_if_oursrÖ   Ú_break_stale_readersr­   Ú_any_readersr×   s   €€rQ   Úreaders_drained_touchingzHSoftReadWriteLock._acquire_writer_slot.<locals>.readers_drained_touching  sù   ø€ Ø”Ô"ð /ð /ð ×8Ò8¸Ñ?Ô?ð !È×HaÒHaÐbgÑHhÔHhð !Ø ð	/ð /ð /ñ /ô /ð /ð /ð /ð
 ×)Ò)­$¬)©+¬+Ñ6Ô6Ð6Ø×,Ò,Ñ.Ô.Ð.ð/ð /ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /ð /ð /s   Ž,BÁ:BÂBÂBr¶   F©r>   r<   )Ú_open_readers_dirÚ	_wait_forr   rŸ   rh   r   )rr   r    r·   r3   rØ   rÞ   s   ``    rQ   rÂ   z&SoftReadWriteLock._acquire_writer_slot  sá   øø€ ð 	×ÒÑ Ô Ð ð	8ð 	8ð 	8ð 	8ð 	8ð 	8ð 	8ð	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	�ŠÐ'°(ÀXˆÑNÔNÐNð	Ø�NŠNÐ3¸hÐQYˆNÑZÔZÐZÐZøÝð 	ð 	ð 	ð ×.Ò.¨uÑ5Ô5Ð5Øð		øøøð
 Œ{Ô  %Ð'Ð's   ¾A Á!A8c                óú   — t          | j        j        | j        t	          j        ¦   «         ¬¦  «         t          | j        j        ¦  «        rdS 	 t          | j        j        |¦  «         n# t          $ r Y dS w xY wdS )N©r6   ÚnowFT)Ú_break_stale_markerrh   r   r6   r­   Ú_file_existsÚ_atomic_create_markerÚFileExistsErrorr×   s     rQ   rÖ   z&SoftReadWriteLock._claim_writer_marker)  s‰   € õ 	˜DœKÔ-¸tÔ?SÕY]ÔYbÑYdÔYdÐeÑeÔeÐeÝ˜œÔ)Ñ*Ô*ð 	Ø�5ð	Ý! $¤+Ô"3°UÑ;Ô;Ð;Ð;øÝð 	ð 	ð 	Ø�5�5ð	øøøàˆts   ÁA* Á*
A8Á7A8c                ó8  — t          | j        j        ¦  «        }|€dS 	 	 t          j        |t
          dz   ¦  «        }n%# t          $ r Y t          j        |¦  «         dS w xY wt          |¦  «        }|�t          j
        |j        |¦  «        s	 t          j        |¦  «         dS t          t          ¦  «        5  t          | j        j        |¬¦  «         d d d ¦  «         n# 1 swxY w Y   	 t          j        |¦  «         dS # t          j        |¦  «         w xY w)NFr”   ©r‘   T)Ú_open_markerrh   r   rF   r   r   r�   r�   Ú_parse_marker_bytesr¥   r¦   r    r   r   )rr   r    r‘   Údatar§   s        rQ   rÛ   z.SoftReadWriteLock._touch_writer_marker_if_ours6  sR  € õ ˜$œ+Ô+Ñ,Ô,ˆØˆ:Ø�5ð	ðÝ”w˜rÕ#3°aÑ#7Ñ8Ô8��øÝð ð ð Øõ ŒH�R‰LŒLˆLˆLˆLðøøøå& tÑ,Ô,ˆDØˆ|¥4Ô#6°t´zÀ5Ñ#IÔ#Iˆ|Øõ
 ŒH�R‰LŒLˆLˆLˆLõ	 �'Ñ"Ô"ð 0ð 0Ý�d”kÔ'¨BÐ/Ñ/Ô/Ð/ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0àåŒH�R‰LŒLˆLˆLˆLø�BŒH�R‰LŒLˆLˆLøøøsP    > ½D ¾
A ÁD ÁA Á .D Â%D Â9C!ÃD Ã!C%Ã%D Ã(C%Ã)D ÄDc               óD  ‡ ‡‡‡‡— ‰                       ¦   «          t          j        ¦   «         j        › dt	          j        ¦   «         › �Š‰ j        Št          t          ‰ j	        j
        ¦  «        ‰z  ¦  «        Šdˆˆˆˆ ˆfd„}‰                      |||¬¦  «         ‰�‰n‰dfS )Nú.r>   r<   c                 óP  •— ‰j         j        5  t          ‰j        j        ‰j        t          j        ¦   «         ¬¦  «         t          ‰j        j        ¦  «        r	 d d d ¦  «         dS ‰ �t          ‰‰‰ ¬¦  «         nt          ‰‰¦  «         	 d d d ¦  «         dS # 1 swxY w Y   d S )Nrã   Fr•   T)	rl   r_   rå   rh   r   r6   r­   ræ   rç   )r–   Úfull_reader_pathÚreader_namerr   r    s   €€€€€rQ   Útry_claim_readerz@SoftReadWriteLock._acquire_reader_slot.<locals>.try_claim_readerW  s  ø€ Ø”Ô"ð ð Ý# D¤KÔ$5ÀtÔG[ÕaeÔajÑalÔalÐmÑmÔmÐmÝ ¤Ô 1Ñ2Ô2ð !Ø ðð ð ñ ô ð ð ð ð Ð%Ý)¨+°uÀVÐLÑLÔLÐLÐLå)Ð*:¸EÑBÔBÐBØðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ŽABÁ(&BÂBÂ"Br¶   Trß   )rà   ÚuuidÚuuid4ÚhexrF   rG   rm   r¢   r   rh   r`   rá   )rr   r    r·   r3   ró   r–   rñ   rò   s   ``   @@@rQ   rÃ   z&SoftReadWriteLock._acquire_reader_slotK  sÇ   øøøøø€ ð 	×ÒÑ Ô Ð Ýœ™œÔ)Ð9Ð9­B¬I©K¬KÐ9Ð9ˆØÔ%ˆÝ�t D¤KÔ$7Ñ8Ô8¸;ÑFÑGÔGÐð		ð 		ð 		ð 		ð 		ð 		ð 		ð 		ð 		ð 		ð 	�ŠÐ'°(ÀXˆÑNÔNÐNØ%Ð1��Ð7GÈ$ÐNÐNrY   Ú	predicateúCallable[[], bool]c               ó$  — 	  |¦   «         rd S t          j        ¦   «         }|st          | j        ¦  «        ‚|�||k    rt          | j        ¦  «        ‚| j        }|�!t          |t          ||z
  d¦  «        ¦  «        }t          j        |¦  «         Œ�)NTg        )r­   r®   r   r8   r7   ÚminÚmaxÚsleep)rr   r÷   r·   r3   rä   Ú	sleep_fors         rQ   rá   zSoftReadWriteLock._wait_fore  sž   € ð	"Øˆy‰{Œ{ð Ø�ÝÔ#Ñ%Ô%ˆCØð .Ý˜dœnÑ-Ô-Ð-ØÐ#¨¨xª¨Ý˜dœnÑ-Ô-Ð-ØÔ*ˆIØÐ#Ý 	­3¨x¸#©~¸sÑ+CÔ+CÑDÔD�	ÝŒJ�yÑ!Ô!Ð!ð	"rY   c           
     óz  — t          | j        j        ¦  «        }t          t          ¦  «        5  |                     d¬¦  «         d d d ¦  «         n# 1 swxY w Y   t          j        | j        j        ¦  «        }t          j	        |j
        ¦  «        st          j        |j
        ¦  «        s| j        j        › d�}t          |¦  «        ‚| j        €èt          rãt          ¦   «         5  t          j        | j        j        t          j        t%          t          dd¦  «        z  t&          z  ¦  «        }	 t)          |¦  «        }nQ# t*          $ rD}	 t          j        |¦  «         n(# t*          $ r}t/          d||¦  «         Y d }~nd }~ww xY w‚ d }~ww xY w|| _        || _        d d d ¦  «         d S # 1 swxY w Y   d S d S d S )NiÀ  )r©   zB exists but is not a directory or is a symlink; refusing to use itÚO_DIRECTORYr   z>reader directory registration and descriptor close both failed)r   rh   r`   r   rè   ÚmkdirrF   ÚlstatÚstatÚS_ISLNKÚst_modeÚS_ISDIRrE   rm   r%   r   ÚopenÚO_RDONLYÚgetattrr!   r   rÉ   r�   r   rn   )rr   Úreaders_pathÚstrN   r‘   r    Úregistration_errorÚclose_errors           rQ   rà   z#SoftReadWriteLock._open_readers_diry  sZ  € Ý˜DœKÔ/Ñ0Ô0ˆÝ•oÑ&Ô&ð 	+ð 	+Ø×Ò EÐÑ*Ô*Ð*ð	+ð 	+ð 	+ñ 	+ô 	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+øøøð 	+ð 	+ð 	+ð 	+õ ŒX�d”kÔ)Ñ*Ô*ˆÝŒ<˜œ
Ñ#Ô#ð 	$­4¬<¸¼
Ñ+CÔ+Cð 	$Ø”[Ô(ÐlÐlÐlˆCÝ˜sÑ#Ô#Ð#ØÔÐ'Õ,<Ð'Ý!Ñ#Ô#ð 3ð 3Ý”W˜Tœ[Ô0µ"´+ÅÍÈMÐ[\Ñ@]Ô@]Ñ2]Õ`kÑ2kÑlÔl�ðÝ6°rÑ:Ô:�E�EøÝ$ð 	ð 	ð 	ðÝœ ™œ˜˜øÝ(ð ð ð Ý-Ø\Ø.Ø'ñô ð ð ð ð ð ð øøøøðøøøð øøøøð	øøøð (*�Ô$Ø-2�Ô*ð3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð 3ð (Ð'Ð'Ð'sl   ®AÁAÁAÃ&A	F,Ä0E Ä?F,Å 
FÅE ÅF	Å 
FÅ*F Å;F	Æ FÆF	Æ	FÆF,Æ,F0Æ3F0c                óž   — t          |                      ¦   «         ¦  «        5 }|D ]} d d d ¦  «         dS 	 d d d ¦  «         n# 1 swxY w Y   dS )NTF)r   Ú_iter_reader_entries)rr   Úentriesr¨   s      rQ   rÝ   zSoftReadWriteLock._any_readers•  s´   € Ý�T×.Ò.Ñ0Ô0Ñ1Ô1ð 	°WØð ð �Øð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ðð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð ˆus   ¢AÁAÁ	AúGenerator[tuple[str, bool]]c              #  ó¾  K  — | j         �Xt          j        | j         ¦  «        5 }|D ]!}t          |j        ¦  «        s|j        dfV — Œ"	 ddd¦  «         n# 1 swxY w Y   dS t          | j        j        ¦  «        }t          j        |¦  «        5 }|D ]1}t          |j        ¦  «        st          ||j        z  ¦  «        dfV — Œ2	 ddd¦  «         dS # 1 swxY w Y   dS )a  
        Yield ``(name, dirfd_relative)`` pairs for every live reader marker.

        ``dirfd_relative`` is ``True`` when *name* should be passed to ``dir_fd=``-aware syscalls; ``False``
        when *name* is a full path because dirfd-relative I/O is unavailable on this platform.

        A consumer that stops early must close this generator: while suspended it holds the ``scandir`` handle open,
        and leaving that to the collector surfaces as an unraisable exception inside whatever runs next.
        NTF)	rm   rF   ÚscandirÚ_is_housekeeping_namer¼   r   rh   r`   r¢   )rr   ÚitÚentryr	  s       rQ   r  z&SoftReadWriteLock._iter_reader_entries›  s˜  è è € ð ÔÐ+Ý”˜DÔ0Ñ1Ô1ð /°RØð /ð /�EÝ0°´Ñ<Ô<ð /Ø#œj¨$Ð.Ð.Ð.Ð.øð/ð/ð /ð /ñ /ô /ð /ð /ð /ð /ð /ð /øøøð /ð /ð /ð /ð ˆFÝ˜DœKÔ/Ñ0Ô0ˆÝŒZ˜Ñ%Ô%ð 	@¨Øð @ð @�Ý,¨U¬ZÑ8Ô8ð @Ý˜l¨U¬ZÑ7Ñ8Ô8¸%Ð?Ð?Ð?Ð?øð@ð	@ð 	@ð 	@ñ 	@ô 	@ð 	@ð 	@ð 	@ð 	@ð 	@ð 	@ð 	@øøøð 	@ð 	@ð 	@ð 	@ð 	@ð 	@s#   £%AÁAÁAÂ5CÃCÃCrä   c                ó4  — g }	 t          |                      ¦   «         ¦  «        5 }|D ]%\  }}|                     ||r| j        nd f¦  «         Œ&	 d d d ¦  «         n# 1 swxY w Y   n# t          $ r Y d S w xY w|D ]\  }}t          || j        ||¬¦  «         Œd S )N)r6   rä   r–   )r   r  Úappendrm   r�   rå   r6   )rr   rä   Únamesr  r¼   Údirfd_relativer‘   s          rQ   rÜ   z&SoftReadWriteLock._break_stale_readers±  s1  € Ø.0ˆð	Ý˜×2Ò2Ñ4Ô4Ñ5Ô5ð [¸Ø,3ð [ð [Ñ(�D˜.Ø—L’L $ÀÐ(X¨Ô(<Ð(<ÐTXÐ!YÑZÔZÐZÐZð[ð[ð [ð [ñ [ô [ð [ð [ð [ð [ð [ð [øøøð [ð [ð [ð [øøõ ð 	ð 	ð 	ØˆFˆFð	øøøàð 	`ð 	`‰HˆD�"Ý °dÔ6JÐPSÐ\^Ð_Ñ_Ô_Ð_Ð_ð	`ð 	`s4   „!A' ¥)AÁA' ÁAÁA' Á"AÁ#A' Á'
A5Á4A5c                óà  — | j         j        5  | j        }|€	 d d d ¦  «         dS |j        }|j        }|j        r| j        nd }d d d ¦  «         n# 1 swxY w Y   	 t          ||¬¦  «        }n# t          $ r Y dS t          $ r Y dS w xY w	 	 t          |¦  «        }n%# t          $ r Y t          j        |¦  «         dS w xY wt          |¦  «        }|�t          j        |j        |¦  «        s	 t          j        |¦  «         dS t!          t          ¦  «        5  t#          ||¬¦  «         d d d ¦  «         n# 1 swxY w Y   	 t          j        |¦  «         dS # t          j        |¦  «         w xY w)NFr•   Trê   )rl   rc   ro   rž   r    rœ   rm   Ú_open_marker_fdÚFileNotFoundErrorr�   Ú_read_marker_fdrF   r�   rì   r¥   r¦   r   r   )rr   r¡   rž   r    r–   r‘   rí   r§   s           rQ   rÆ   z!SoftReadWriteLock._refresh_marker¼  sP  € ØŒ[Ô!ð 	Fð 	FØ”:ˆDØˆ|Øð	Fð 	Fð 	Fñ 	Fô 	Fð 	Fð 	Fð 	Fð Ô*ˆKØ”JˆEØ-1¬^ÐE�TÔ)Ð)ÀˆFð	Fð 	Fð 	Fñ 	Fô 	Fð 	Fð 	Fð 	Fð 	Fð 	Fð 	Føøøð 	Fð 	Fð 	Fð 	Fð	Ý  °VÐ<Ñ<Ô<ˆBˆBøÝ ð 	ð 	ð 	Ø�5�5Ýð 	ð 	ð 	Ø�4�4ð	øøøð	ðÝ& rÑ*Ô*��øÝð ð ð Øõ ŒH�R‰LŒLˆLˆLˆLðøøøå& tÑ,Ô,ˆDð ˆ|¥4Ô#6°t´zÀ5Ñ#IÔ#Iˆ|Øõ ŒH�R‰LŒLˆLˆLˆLõ	 �'Ñ"Ô"ð *ð *Ý�k bÐ)Ñ)Ô)Ð)ð*ð *ð *ñ *ô *ð *ð *ð *ð *ð *ð *øøøð *ð *ð *ð *àåŒH�R‰LŒLˆLˆLˆLø�BŒH�R‰LŒLˆLˆLøøøs‚   �A¥AÁAÁAÁA- Á-
BÁ:	BÂBÂB ÂE Â
B>Â&E Â=B>Â>.E ÄE ÄD5Ä)E Ä5D9Ä9E Ä<D9Ä=E ÅE-c                ó¶   — t          t          j        ¦   «         t          j        ¦   «         | j        j        ¬¦  «        | _        d | _        d | _        d | _        d S )Nrb   )ri   rj   rk   rl   r_   ro   rm   rn   ©rr   s    rQ   Ú_reset_after_fork_in_childz,SoftReadWriteLock._reset_after_fork_in_childå  sU   € ÝÝ”^Ñ%Ô%Ý!œÑ(Ô(Ø”+Ô#ð
ñ 
ô 
ˆŒð
 ˆŒ
Ø#ˆÔØ%)ˆÔ"Ð"Ð"rY   rR   )r8   r9   r:   r;   r3   r<   r4   r<   r5   r;   r6   r=   r7   r;   r>   r[   ©r>   r[   ru   )r:   r=   r3   rz   r>   r{   )r:   r=   r3   rz   r>   r   )r8   r9   r:   r;   r3   r<   r>   r?   )rŽ   r<   r>   r[   )r    r¢   r>   r[   )r©   rª   r:   r=   r3   rz   r>   r   )
r©   rª   r³   r;   r±   r;   r3   r<   r>   r   )r©   rª   r>   r   )r    r¢   r·   r=   r3   r<   r>   rÓ   )r    r¢   r>   r<   )r÷   rø   r·   r=   r3   r<   r>   r[   rß   )r>   r  )rä   r;   r>   r[   )$rS   rT   rU   Ú__doc__r   r-   rV   rj   rv   r.   rs   Úclassmethodrx   r   r€   r„   r}   rƒ   r‹   r�   r~   rŸ   r‡   r°   r¬   rÂ   rÖ   rÛ   rÃ   rá   rà   rÝ   r  rÜ   rÆ   r   rŠ   rY   rQ   r?   r?   s   s  € € € € € € ð+ð +ðZ @SÐ?RÑ?TÔ?T€JÐTÐTÐTÑTØ%�i”oÑ'Ô'€Oð
 ð1$ð
 Ø!Ø$(Ø(,Ø#ð1$ð 1$ð 1$ð 1$ð 1$ð 1$ðf ð/ð /ð /ñ „[ð/ð ðÐQUð ð ð ð ð ñ „^ðð& ðÐRVð ð ð ð ð ñ „^ðð&AÐTXð Að Að Að Að Að Að.BÐUYð Bð Bð Bð Bð Bð Bð6 ð ð:ð
 ð:ð :ð :ð :ð :ñ „[ð:ð*%ð %ð %ð %ð. (-ð %;ð %;ð %;ð %;ð %;ð %;ðN'ð 'ð 'ð 'ð .ð  .ð  .ð  .ðD3-ð 3-ð 3-ð 3-ðj-ð -ð -ð -ð( (ð  (ð  (ð  (ðDð ð ð ðð ð ð ð*Oð Oð Oð Oð4"ð "ð "ð "ð(3ð 3ð 3ð 3ð8ð ð ð ð@ð @ð @ð @ð,	`ð 	`ð 	`ð 	`ð'ð 'ð 'ð 'ðR*ð *ð *ð *ð *ð *rY   r?   )Ú	metaclassc                  ó(   ‡ — e Zd Zdˆ fd„Zdd„Zˆ xZS )rÅ   r¹   rø   rº   r;   r»   úthreading.Eventr¼   r¢   r>   r[   c                óx   •— t          ¦   «                              |d¬¦  «         || _        || _        || _        d S )NT)r¼   Údaemon)rA   rs   Ú_refreshÚ	_intervalÚ_stop_event)rr   r¹   rº   r»   r¼   rP   s        €rQ   rs   z_HeartbeatThread.__init__ñ  s>   ø€ õ 	‰Œ×Ò˜d¨4ÐÑ0Ô0Ð0ØˆŒØ!ˆŒØ%ˆÔÐÐrY   c                óä   — | j                              | j        ¦  «        sP|                      ¦   «         s| j                              ¦   «          d S | j                              | j        ¦  «        ¯Nd S d S ru   )r+  Úwaitr*  r)  r™   r  s    rQ   Úrunz_HeartbeatThread.runý  sx   € ØÔ"×'Ò'¨¬Ñ7Ô7ð 	Ø—=’=‘?”?ð ØÔ ×$Ò$Ñ&Ô&Ð&Ø�ð Ô"×'Ò'¨¬Ñ7Ô7ð 	ð 	ð 	ð 	ð 	rY   )
r¹   rø   rº   r;   r»   r&  r¼   r¢   r>   r[   r!  )rS   rT   rU   rs   r.  rW   rX   s   @rQ   rÅ   rÅ   ð  sQ   ø€ € € € € ð
&ð 
&ð 
&ð 
&ð 
&ð 
&ðð ð ð ð ð ð ð rY   rÅ   r•   r¼   r¢   r–   ú
int | Noner>   ú'tuple[_MarkerInfo | None, float] | Nonec               óÒ  — t          | |¬¦  «        }|€d S 	 t          j        |¦  «        }t          j        |j        ¦  «        sd |j        ft          j        |¦  «         S t          j        |t          dz   ¦  «        }n%# t          $ r Y t          j        |¦  «         d S w xY w	 t          j        |¦  «         n# t          j        |¦  «         w xY wt          |¦  «        |j        fS )Nr•   r”   )rë   rF   Úfstatr  ÚS_ISREGr  Úst_mtimer�   r   r   r�   rì   )r¼   r–   r‘   r
  rí   s        rQ   r¤   r¤     sè   € Ý	�d 6Ð	*Ñ	*Ô	*€BØ	€zØˆtðÝŒX�b‰\Œ\ˆõ
 Œ|˜BœJÑ'Ô'ð 	%Ø˜œÐ$õ
 	Œ�‰Œˆˆõ	 Œw�rÕ+¨aÑ/Ñ0Ô0ˆˆøÝð ð ð Øå
Œ�‰Œˆˆˆðøøøð 	õ 	Œ�‰Œˆˆø�Œ�‰ŒˆˆøøøÝ˜tÑ$Ô$ b¤kÐ1Ð1s/   —5A? Á!A? Á>B: Á?
B!Â	B: Â B!Â!B: Â:Cr‘   ÚintÚbytesc                ó<   — t          j        | t          dz   ¦  «        S )Nr”   )rF   r   r   rê   s    rQ   r  r    s   € ÝŒ7�2Õ'¨!Ñ+Ñ,Ô,Ð,rY   c               ó¤   — t           j        t          z  t          z  }t          r|�t          j        | ||¬¦  «        nt          j        | |¦  «        S ©Nr•   )rF   r  r!   r#   r%   r  )r¼   r–   Úflagss      rQ   r  r    sK   € õ ŒK�+Ñ%­Ñ3€EÝ2BÐsÀvÐGY�2Œ7�4˜ vÐ.Ñ.Ô.Ð.Õ_aÔ_fÐgkÐmrÑ_sÔ_sÐsrY   c               óH   — 	 t          | |¬¦  «        S # t          $ r Y d S w xY wr9  )r  r�   ©r¼   r–   s     rQ   rë   rë   $  s<   € ðÝ˜t¨FÐ3Ñ3Ô3Ð3øÝð ð ð Øˆtˆtðøøøs   ‚ “
! !rí   ú_MarkerInfo | Nonec                óJ  — | rt          | ¦  «        t          k    rd S 	 |                      d¦  «        }n# t          $ r Y d S w xY wt	          j        d|t          j        ¦  «        }|€d S t          |d         d¦  «        }|dk    rd S t          |d         ||d         ¬¦  «        S )	NÚasciiuå  
        \A                                  # start of string
        (?P<token>    [0-9a-f]{32}     ) \n # 128-bit hex token
        (?P<pid>      [1-9][0-9]{0,9}  ) \n # decimal pid: no leading zero, â‰¤ 10 digits
        (?P<hostname> [\x21-\x7e]{1,253})   # printable non-whitespace ASCII (RFC 1123 hostname limit)
        \n*                                 # tolerate sloppy writers that append extra newlines
        \Z                                  # end of string
        Úpidé
   iÿÿÿr    Úhostname)r    r@  rB  )	Úlenr   ÚdecodeÚUnicodeDecodeErrorÚreÚmatchÚVERBOSEr5  Ú_MarkerInfo)rí   ÚtextrG  r@  s       rQ   rì   rì   +  sÇ   € ð ð •3�t‘9”9Õ/Ò/Ð/ØˆtðØ�{Š{˜7Ñ#Ô#ˆˆøÝð ð ð ØˆtˆtðøøøåŒHð	ð 	Ý
Œ
ñô €Eð €}ØˆtÝ
ˆe�EŒl˜BÑ
Ô
€CØ
ˆY‚€ØˆtÝ˜U 7œ^°¸uÀZÔ?PÐQÑQÔQÐQs   ž4 ´
AÁAr[   c               óâ   — t          t          ¦  «        5  t          r|�t          j        | |¬¦  «         n!t          | ¦  «                             ¦   «          d d d ¦  «         d S # 1 swxY w Y   d S r9  )r   r  r%   rF   Úunlinkr   r<  s     rQ   r�   r�   I  s²   € Ý	Õ#Ñ	$Ô	$ð  ð  Ýð 	  Ð 2åŒI�d 6Ð*Ñ*Ô*Ð*Ð*å�‰JŒJ×ÒÑÔÐð ð  ð  ñ  ô  ð  ð  ð  ð  ð  ð  ð  øøøð  ð  ð  ð  ð  ð  s   •AA$Á$A(Á+A(r6   r;   rä   r<   c               ób  — t          | |¬¦  «        x}€dS |\  }}||z
  |k    rdS |€t          | |¬¦  «         dS | › t          › dt          j        ¦   «         › dt          j        d¦  «        › �}	 t          r|�t          j        | |||¬¦  «         n"t          | ¦  «                             |¦  «         n# t          $ r Y dS w xY wt          ||¬¦  «        }|€dS |\  }	}
|	€t          ||¬¦  «         dS t          j        |j        |	j        ¦  «        sdS |
|k    rdS t          ||¬¦  «         dS )Nr•   FTrï   rµ   )Ú
src_dir_fdÚ
dst_dir_fd)r¤   r�   r   rF   rG   rÀ   rÁ   r%   Úrenamer   r�   r¥   r¦   r    )r¼   r6   rä   r–   Úread_resultÚinfo_beforeÚmtime_beforeÚ
break_nameÚ
read_afterÚ
info_afterÚmtime_afters              rQ   rå   rå   R  s‰  € õ $ D°Ð8Ñ8Ô8Ð8ˆÐAØˆuØ +Ñ€K�Ø
ˆ\Ñ˜_Ò,Ð,ØˆuØÐÝ�˜VÐ$Ñ$Ô$Ð$ØˆtàÐO�-ÐOÐO­"¬)©+¬+ÐOÐO½Ô8IÈ"Ñ8MÔ8MÐOÐO€JðÝð 	* Ð 2ÝŒI�d˜J°6ÀfÐMÑMÔMÐMÐMå�‰JŒJ×Ò˜jÑ)Ô)Ð)øøÝð ð ð Øˆuˆuðøøøõ ˜j°Ð8Ñ8Ô8€JØÐØˆuØ(Ñ€J�ØÐÝ�
 6Ð*Ñ*Ô*Ð*ØˆtÝÔ˜{Ô0°*Ô2BÑCÔCð ØˆuØ�\Ò!Ð!ØˆuÝˆJ˜vÐ&Ñ&Ô&Ð&Øˆ4s   Á0AB5 Â5
CÃCr    c          	     óp  — t           j        t           j        z  t           j        z  t          z  }t
          r|�t          j        | |d|¬¦  «        }nt          j        | |d¦  «        }d }	 t          j        |¦  «        }|j        |j	        f}t          ||› dt          j        ¦   «         › dt          j        ¦   «         › d�                     d¦  «        ¦  «         t          j        |¦  «         d S # t           $ r; t          j        |¦  «         |�#t#          | ||¬¦  «        rt%          | |¬¦  «         ‚ w xY w)Ni€  r•   ú
r?  )rF   ÚO_CREATÚO_EXCLÚO_WRONLYr!   r%   r  r2  Úst_devÚst_inor   rG   ÚsocketÚgethostnameÚencoder�   rÉ   Ú
_same_filer�   )r¼   r    r–   r:  r‘   Úidentityr
  s          rQ   rç   rç   ~  s3  € õ ŒJ�œÑ"¥R¤[Ñ0µ;Ñ>€EÝð )˜FÐ.ÝŒW�T˜5 %°Ð7Ñ7Ô7ˆˆåŒW�T˜5 %Ñ(Ô(ˆð (,€Hð
ÝŒX�b‰\Œ\ˆØ”9˜bœiÐ'ˆÝ�"˜ÐIÐI¥"¤)¡+¤+ÐIÐIµÔ1CÑ1EÔ1EÐIÐIÐI×PÒPÐQXÑYÔYÑZÔZÐZõ 	Œ�‰Œˆˆˆøõ ð ð ð Ý
Œ�‰ŒˆØÐ¥J¨t°XÀfÐ$MÑ$MÔ$MÐÝ�D Ð(Ñ(Ô(Ð(Øð	øøøs   Á*A0C0 Ã0AD5rc  útuple[int, int]c               ó²   — 	 t           r|�t          j        | |¬¦  «        nt          j        | ¦  «        }n# t          $ r Y dS w xY w|j        |j        f|k    S )Nr•   F)r%   rF   r  r�   r]  r^  )r¼   rc  r–   r
  s       rQ   rb  rb  –  so   € ðÝ.>ÐiÀ6ÐCU�RŒX�d 6Ð*Ñ*Ô*Ð*Õ[]Ô[cÐdhÑ[iÔ[iˆˆøÝð ð ð ØˆuˆuðøøøàŒI�r”yÐ! XÒ-Ð-s   ‚36 ¶
AÁAÚpathc                ó‚   — 	 t          j        | ¦  «        }n# t          $ r Y dS w xY wt          j        |j        ¦  «        S rÚ   )rF   r  r  r  r3  r  )rf  r
  s     rQ   ræ   ræ   ž  sJ   € ðÝŒX�d‰^Œ^ˆˆøÝð ð ð ØˆuˆuðøøøåŒ<˜œ
Ñ#Ô#Ð#s   ‚ —
%¤%c                ó>   — |                       d¦  «        pt          | v S )Nrï   )Ú
startswithr   )r¼   s    rQ   r  r  ¦  s   € Ø�?Š?˜3ÑÔÐ8¥=°DÐ#8Ð8rY   T)Úfrozenc                  ó.   — e Zd ZU ded<   ded<   ded<   dS )rg   r¢   r_   r   r`   N©rS   rT   rU   rV   rŠ   rY   rQ   rg   rg   ª  s+   € € € € € € à€J€J�JØ€J€J�JØ€L€L�L€L€LrY   rg   c                  ó.   — e Zd ZU ded<   ded<   ded<   dS )ri   r'   rc   rd   r   r_   Nrl  rŠ   rY   rQ   ri   ri   ±  s6   € € € € € € àÐÐÑØÐÐÑØÐÐÑÐÐrY   ri   c                  ó.   — e Zd ZU ded<   ded<   ded<   dS )rI  r¢   r    r5  r@  rB  Nrl  rŠ   rY   rQ   rI  rI  ¸  s+   € € € € € € à€J€J�JØ€H€H�HØ€M€M�M€M€MrY   rI  c                  ód   — e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   ded<   dS )rÇ   zYEverything that exists only while a lock is held; ``None`` when the instance has no lock.r5  r—   rª   r©   r/  r½   r¢   rž   r<   rœ   r    rÅ   rš   r&  r˜   N)rS   rT   rU   r"  rV   rŠ   rY   rQ   rÇ   rÇ   ¿  sl   € € € € € € àcÐcà€J€J�JØ€K€K�KØÐÐÑØÐÐÑØ€O€O�OØ€J€J�JØ&Ð&Ð&Ñ&Ø#Ð#Ð#Ñ#Ð#Ð#rY   rÇ   c                 óÜ   — t          t                               ¦   «         ¦  «        D ]D} t          t          ¦  «        5  |                      d¬¦  «         d d d ¦  «         n# 1 swxY w Y   ŒEd S )NTr�   )Úlistr&   Úvaluesr   Ú	Exceptionr~   )rM   s    rQ   Ú_cleanup_all_instancesrt  Í  sª   € Ý�×.Ò.Ñ0Ô0Ñ1Ô1ð )ð )ˆÝ•iÑ Ô ð 	)ð 	)Ø×Ò 4ÐÑ(Ô(Ð(ð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)øð)ð )s   ½A Á A$	Á'A$	)r¼   r¢   r–   r/  r>   r0  )r‘   r5  r>   r6  )r¼   r¢   r–   r/  r>   r5  )r¼   r¢   r–   r/  r>   r/  )rí   r6  r>   r=  )r¼   r¢   r–   r/  r>   r[   )
r¼   r¢   r6   r;   rä   r;   r–   r/  r>   r<   )r¼   r¢   r    r¢   r–   r/  r>   r[   )r¼   r¢   rc  rd  r–   r/  r>   r<   )rf  r¢   r>   r<   )r¼   r¢   r>   r<   r!  )Wr"  Ú
__future__r   Úatexitr¥   rF   rF  rÀ   r_  r  Úsysrj   r­   rô   Ú
contextlibr   r   r   Údataclassesr   Úpathlibr   Útypingr	   r
   r   Úweakrefr   Úfilelock._apir   r   r   r   r   r   r   r   Úfilelock._errorr   Úfilelock._softr   Úfilelock._utilr   r   r   Úcollections.abcr   r   rª   r   rV   r   r  r!   r#   Úplatformr  Úsupports_dir_fdr%   r&   rk   r(   r™   r)   Útyper+   r?   ÚThreadrÅ   r¤   r  r  rë   rì   r�   rå   rç   rb  ræ   r  rg   ri   rI  rÇ   rt  ÚregisterÚ__all__rŠ   rY   rQ   ú<module>rˆ     s°  ðØ `Ð `Ð `à "Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø €€€Ø €€€Ø 
€
€
€
Ø Ð Ð Ð Ø €€€Ø €€€Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð $Ð #Ð #Ð #Ð #Ð #Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ DÐ Dàð 4Ø3Ð3Ð3Ð3Ð3Ð3Ð3Ð3ð 	�Ô €Ø$€Ð $Ð $Ð $Ñ $Ø#Ð Ð #Ð #Ð #Ñ #Ø!˜' " l°AÑ6Ô6€Ð 6Ð 6Ð 6Ñ 6Ø!˜' " l°AÑ6Ô6€Ð 6Ð 6Ð 6Ñ 6ð !$¤°Ò 7Ð Y¸B¼GÀrÔGYÐ<YÐ Ð YÐ YÐ YÑ YàEXÐEXÑEZÔEZ€Ð ZÐ ZÐ ZÑ ZØ&4 i¤nÑ&6Ô&6Ð Ð 6Ð 6Ð 6Ñ 6Ø36°3±5´5Ð Ð 8Ð 8Ð 8Ñ 8ð:ð :ð :ð :ð :�$ñ :ô :ð :ðzz	*ð z	*ð z	*ð z	*ð z	* +ð z	*ñ z	*ô z	*ð z	*ðzð ð ð ð �yÔ'ñ ô ð ð( 59ð 2ð 2ð 2ð 2ð 2ð 2ð(-ð -ð -ð -ð 8<ð tð tð tð tð tð tð 59ð ð ð ð ð ð ðRð Rð Rð Rð< 04ð  ð  ð  ð  ð  ð  ð ð)ð )ð )ð )ð )ð )ðX JNð ð ð ð ð ð ð0.ð .ð .ð .ð$ð $ð $ð $ð9ð 9ð 9ð 9ð €�$ÐÑÔðð ð ð ð ñ ô ñ Ôðð ðð ð ð ð ñ ô ñ „ðð €�$ÐÑÔðð ð ð ð ñ ô ñ Ôðð ð
$ð 
$ð 
$ð 
$ð 
$ñ 
$ô 
$ñ „ð
$ð)ð )ð )ð )ð €„Ð&Ñ 'Ô 'Ð 'Ø Ð Ð&Ñ 'Ô 'Ð 'ð ð€€€rY   