Your IP : 18.216.167.229
B
���a� � @ s� d dl mZ d dlZd dlZd dlmZ d dlmZ ddlm Z dZ
ejdkrbG d d
� d
e e�Zn6yd dl
Z
W n ek
r� Y nX dZ
G dd
� d
e �Zd
d
gZdS )� )�annotationsN)�ABC)�cast� )�BaseFileLockF�win32c @ s e Zd ZdZdS )�UnixFileLockzHUses the :func:`fcntl.flock` to hard lock the lock file on unix systems.N)�__name__�
__module__�__qualname__�__doc__� r
r
�?/opt/alt/python37/lib/python3.7/site-packages/filelock/_unix.pyr s r Tc @ s, e Zd ZdZdd�dd�Zdd�dd�ZdS ) r zHUses the :func:`fcntl.flock` to hard lock the lock file on unix systems.�None)�returnc C sb t jt jB t jB }t �| j|�}yt�|tjtj B � W n t
k
rV t �|� Y nX || _d S )N)
�os�O_RDWR�O_CREAT�O_TRUNC�openZ
_lock_file�fcntl�flockZLOCK_EXZLOCK_NB�OSError�close�
_lock_file_fd)�selfZ open_mode�fdr
r
r �_acquire s zUnixFileLock._acquirec C s. t t| j�}d | _t�|tj� t�|� d S )N)r �intr r r ZLOCK_UNr r )r r r
r
r �_release&