HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python38/lib/python3.8/site-packages/lockfile/__pycache__/linklockfile.cpython-38.pyc
U

��UV\
�@sPddlmZddlZddlZddlmZmZmZmZm	Z	m
Z
Gdd�de�ZdS)�)�absolute_importN�)�LockBase�
LockFailed�	NotLocked�	NotMyLock�LockTimeout�
AlreadyLockedc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�LinkLockFilez�Lock access to a file using atomic property of link(2).

    >>> lock = LinkLockFile('somefile')
    >>> lock = LinkLockFile('somefile', threaded=False)
    NcCs zt|jd���Wn"tk
r6td|j��YnX|dk	rD|n|j}t��}|dk	rj|dkrj||7}zt�|j|j	�Wn�t
k
�rt�|j�j}|dkr�YdS|dk	r�t��|kr�t�
|j�|dkr�td|j��ntd|j��t�|dk	�r
|d�pd�YqjXdSqjdS)	N�wbzfailed to create %sr�z&Timeout waiting to acquire lock for %sz%s is already locked�
g�������?)�open�unique_name�close�IOErrorr�timeout�time�os�link�	lock_file�OSError�stat�st_nlink�unlinkr�pathr	�sleep)�selfr�end_timeZnlinks�r�F/opt/alt/python38/lib/python3.8/site-packages/lockfile/linklockfile.py�acquires2��$zLinkLockFile.acquirecCsP|��std|j��ntj�|j�s4td|j��t�|j�t�|j�dS)Nz%s is not lockedz%s is locked, but not by me)	�	is_lockedrrr�existsrrrr�rrrr �release7szLinkLockFile.releasecCstj�|j�S�N)rrr#rr$rrr r"?szLinkLockFile.is_lockedcCs(|��o&tj�|j�o&t�|j�jdkS)Nr)r"rrr#rrrr$rrr �i_am_lockingBs
��zLinkLockFile.i_am_lockingcCstj�|j�rt�|j�dSr&)rrr#rrr$rrr �
break_lockGszLinkLockFile.break_lock)N)	�__name__�
__module__�__qualname__�__doc__r!r%r"r'r(rrrr r

s
&r
)�
__future__rrr�rrrrrr	r
rrrr �<module>s