Ë
    [^(h‹  ã                   ó(   — d dl Z d dlZ G d„ d«      Zy)é    Nc                   ó*   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zy)Ú	FileBatonz0A primitive, file-based synchronization utility.c                 ó.   — || _         || _        d| _        y)zð
        Create a new :class:`FileBaton`.

        Args:
            lock_file_path: The path to the file used for locking.
            wait_seconds: The seconds to periodically sleep (spin) when
                calling ``wait()``.
        N)Úlock_file_pathÚwait_secondsÚfd)Úselfr   r   s      úT/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/utils/file_baton.pyÚ__init__zFileBaton.__init__	   s   € ð -ˆÔØ(ˆÔØˆ�ó    c                 ó¬   — 	 t        j                  | j                  t         j                  t         j                  z  «      | _        y# t        $ r Y yw xY w)z–
        Try to atomically create a file under exclusive access.

        Returns:
            True if the file could be created, else False.
        TF)ÚosÚopenr   ÚO_CREATÚO_EXCLr   ÚFileExistsError©r	   s    r
   Útry_acquirezFileBaton.try_acquire   sA   € ð	Ü—g‘g˜d×1Ñ1´2·:±:ÄÇ	Á	Ñ3IÓJˆDŒGØøÜò 	Ùð	ús   ‚AA Á	AÁAc                 óê   — t         j                  j                  | j                  «      rJt	        j
                  | j                  «       t         j                  j                  | j                  «      rŒIyy)zÆ
        Periodically sleeps for a certain amount until the baton is released.

        The amount of time slept depends on the ``wait_seconds`` parameter
        passed to the constructor.
        N)r   ÚpathÚexistsr   ÚtimeÚsleepr   r   s    r
   ÚwaitzFileBaton.wait#   sD   € ô �g‰g�n‰n˜T×0Ñ0Ô1Ü�J‰J�t×(Ñ(Ô)ô �g‰g�n‰n˜T×0Ñ0×1r   c                 ó˜   — | j                   �t        j                  | j                   «       t        j                  | j                  «       y)z'Release the baton and removes its file.N)r   r   ÚcloseÚremover   r   s    r
   ÚreleasezFileBaton.release-   s.   € à�7‰7ÐÜ�H‰H�T—W‘WÔä
�	‰	�$×%Ñ%Õ&r   N)gš™™™™™¹?)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   © r   r
   r   r      s   „ Ù:óòò*ó'r   r   )r   r   r   r#   r   r
   ú<module>r$      s   ðã 	Û ÷,'ò ,'r   