File: //usr/lib/python3/dist-packages/virtualenv/util/__pycache__/lock.cpython-310.pyc
o
$�"b� � @ s� d Z ddlmZmZ ddlZddlZddlmZmZ ddl m
Z
ddlmZm
Z
ddlmZmZ ddlmZ dd lmZ G d
d� de�Zi Ze� Zee�G dd
� d
e��ZG dd� de�ZG dd� de�ZdZdS )z7holds locking functionality that works across processes� )�absolute_import�unicode_literalsN)�ABCMeta�abstractmethod)�contextmanager)�Lock�RLock)�FileLock�Timeout)�
add_metaclass)�Pathc s8 e Zd Z� fdd�Zd
� fdd� Zd� fdd � Z� ZS )�_CountedFileLockc s\ t j�|�}t j�|�szt �|� W n ty Y nw tt| ��|� d| _ t
� | _d S �Nr )�os�path�dirname�isdir�makedirs�OSError�superr
�__init__�countr �thread_safe)�self� lock_file�parent�� __class__� �6/usr/lib/python3/dist-packages/virtualenv/util/lock.pyr s �z_CountedFileLock.__init__N皙�����?c sV | j � | jdkrtt| ��||� | jd7 _W d � d S 1 s$w Y d S )Nr � )r r r r
�acquire)r �timeout�
poll_intervalr r r r"