
    Mܶi                     R    d dl mZ d dlmZ d dlmZ d dlmZ  G d de          ZdS )    )TracebackType)Self)FileLock)_WaitCounterc                   b     e Zd ZdZdef fdZdee         dz  dedz  dedz  ddf fdZ	 xZ
S )	r   a~  
    This behaves like a normal file lock.

    However, it adds waitcounters for acquiring and releasing the filelock
    as well as for the critical region within it.

    pytorch.filelock.enter - While we're acquiring the filelock.
    pytorch.filelock.region - While we're holding the filelock and doing work.
    pytorch.filelock.exit - While we're releasing the filelock.
    returnc                 8   t          d                                          | _        t          d                                          5  t                                                      }d d d            n# 1 swxY w Y   | j                                         |S )Nzpytorch.filelock.regionzpytorch.filelock.enter)r   guardregion_countersuper	__enter__)selfresult	__class__s     Z/root/projects/openclaw-proxy/venv/lib64/python3.11/site-packages/torch/utils/_filelock.pyr   zFileLock.__enter__   s    *+DEEKKMM23399;; 	) 	)WW&&((F	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)%%'''s   	!A66A:=A:exc_typeN	exc_value	tracebackc                     | j                                          t          d                                          5  t	                                          |||           d d d            n# 1 swxY w Y   d S )Nzpytorch.filelock.exit)r   __exit__r   r
   r   )r   r   r   r   r   s       r   r   zFileLock.__exit__   s     	$$&&&12288:: 	= 	= GGXy)<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= ts   $A,,A03A0)__name__
__module____qualname____doc__r   r   typeBaseExceptionr   r   __classcell__)r   s   @r   r   r   	   s        	 	4      }%, !4' !4'	
 
             r   N)	typesr   typing_extensionsr   filelockr   base_FileLocktorch.monitorr    r   r   <module>r%      s          " " " " " " . . . . . . & & & & & &         }          r   