§
    Ë²Åj½  ã                   ó0   — d dl Z d dlZ G d„ d¦  «        ZdS )é    Nc                   ó,   — e Zd ZdZdd„Zd„ Zd„ Zd„ ZdS )	Ú	FileBatonz0A primitive, file-based synchronization utility.çš™™™™™¹?c                 ó0   — || _         || _        d| _        dS )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      úGC:\Projects\Historical\venv\Lib\site-packages\torch/utils/file_baton.pyÚ__init__zFileBaton.__init__	   s   € ð -ˆÔØ(ˆÔØˆŒˆˆó    c                 ó–   — 	 t          j        | j        t           j        t           j        z  ¦  «        | _        dS # t          $ r Y dS 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   sM   € ð	Ý”g˜dÔ1µ2´:ÅÄ	Ñ3IÑJÔJˆDŒGØ�4øÝð 	ð 	ð 	Ø�5�5ð	øøøs   ‚6: º
AÁAc                 óÌ   — t           j                             | j        ¦  «        r?t	          j        | j        ¦  «         t           j                             | j        ¦  «        °=dS dS )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#   s_   € õ Œg�nŠn˜TÔ0Ñ1Ô1ð 	*ÝŒJ�tÔ(Ñ)Ô)Ð)õ Œg�nŠn˜TÔ0Ñ1Ô1ð 	*ð 	*ð 	*ð 	*ð 	*r   c                 óx   — | j         �t          j        | j         ¦  «         t          j        | j        ¦  «         dS )z'Release the baton and removes its file.N)r	   r   ÚcloseÚremover   r   s    r   ÚreleasezFileBaton.release-   s5   € àŒ7ÐÝŒH�T”WÑÔÐå
Œ	�$Ô%Ñ&Ô&Ð&Ð&Ð&r   N)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   © r   r   r   r      s[   € € € € € Ø:Ð:ðð ð ð ðð ð ð*ð *ð *ð'ð 'ð 'ð 'ð 'r   r   )r   r   r   r$   r   r   ú<module>r%      sI   ðà 	€	€	€	Ø €€€ð,'ð ,'ð ,'ð ,'ð ,'ñ ,'ô ,'ð ,'ð ,'ð ,'r   