관리-도구
편집 파일: lock.cpython-37.pyc
B ���a� � @ 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�|�s<yt �|� W n tk r: Y nX tt| ��|� d| _ t � | _d S )Nr )�os�path�dirname�isdir�makedirs�OSError�superr �__init__�countr �thread_safe)�self� lock_file�parent)� __class__� �E/opt/alt/python37/lib/python3.7/site-packages/virtualenv/util/lock.pyr s z_CountedFileLock.__init__N皙�����?c s@ | j �0 | jdkr$tt| ��||� | jd7 _W d Q R X d S )Nr � )r r r r �acquire)r �timeoutZ poll_interval)r r r r s z_CountedFileLock.acquireFc sD | j �4 | jdkr$tt| �j|d� t| jd d�| _W d Q R X d S )Nr )�forcer )r r r r �release�max)r r"