
    3Ki                     J    S SK Jr  S SKJr  S SKJr  S SKJr   " S S\5      rg)    )TracebackType)Self)FileLock)_WaitCounterc                   l   ^  \ rS rSrSrS\4U 4S jjrS\\   S-  S\S-  S\	S-  SS4U 4S	 jjr
S
rU =r$ )r   	   ab  
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                    > [        S5      R                  5       U l        [        S5      R                  5          [        TU ]  5       nS S S 5        U R                  R	                  5         W$ ! , (       d  f       N*= f)Nzpytorch.filelock.regionzpytorch.filelock.enter)r   guardregion_countersuper	__enter__)selfresult	__class__s     W/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/torch/utils/_filelock.pyr   FileLock.__enter__   s^    *+DEKKM2399;W&(F <%%' <;s   A,,
A:exc_typeN	exc_value	tracebackc                    > U R                   R                  5         [        S5      R                  5          [        TU ]  XU5        S S S 5        g ! , (       d  f       g = f)Nzpytorch.filelock.exit)r   __exit__r   r   r   )r   r   r   r   r   s       r   r   FileLock.__exit__   sR     	$$&1288: GX)< ;  ;: s   A
A)r   )__name__
__module____qualname____firstlineno____doc__r   r   typeBaseExceptionr   r   __static_attributes____classcell__)r   s   @r   r   r   	   sX    	4 }%, !4' !4'	
 
     r   N)	typesr   typing_extensionsr   filelockr   base_FileLocktorch.monitorr    r#   r   <module>r*      s     " . & }  r#   