<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
Pf\
                 @   sP   d dl mZ d dlZd dlZddlmZmZmZmZm	Z	m
Z
 G dd deZdS )    )absolute_importN   )LockBase
LockFailed	NotLocked	NotMyLockLockTimeoutAlreadyLockedc               @   s:   e Zd ZdZdddZdd Zdd Zd	d
 Zdd ZdS )LinkLockFilezLock access to a file using atomic property of link(2).

    >>> lock = LinkLockFile('somefile')
    >>> lock = LinkLockFile('somefile', threaded=False)
    Nc             C   s"  yt | jdj  W n" tk
r6   td| j Y nX |d k	rD|n| j}tj }|d k	rj|dkrj||7 }xytj| j| j	 W n t
k
r   tj| jj}|dkrd S |d k	rtj |krtj| j |dkrtd| j ntd| j tj|d k	r
|d pd Y qlX d S qlW d S )	Nwbzfailed 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	   Zsleep)selfr   Zend_timeZnlinks r   "/usr/lib/python3.6/linklockfile.pyacquire   s0    
$zLinkLockFile.acquirec             C   sP   | j  std| j ntjj| js4td| j tj| j tj| j d S )Nz%s is not lockedz%s is locked, but not by me)		is_lockedr   r   r   existsr   r   r   r   )r   r   r   r   release7   s    zLinkLockFile.releasec             C   s   t jj| jS )N)r   r   r!   r   )r   r   r   r   r    ?   s    zLinkLockFile.is_lockedc             C   s(   | j  o&tjj| jo&tj| jjdkS )Nr   )r    r   r   r!   r   r   r   )r   r   r   r   i_am_lockingB   s    zLinkLockFile.i_am_lockingc             C   s   t jj| jrt j| j d S )N)r   r   r!   r   r   )r   r   r   r   
break_lockG   s    zLinkLockFile.break_lock)N)	__name__
__module____qualname____doc__r   r"   r    r#   r$   r   r   r   r   r
   
   s   
&r
   )Z
__future__r   r   r    r   r   r   r   r   r	   r
   r   r   r   r   <module>   s    