관리-도구
편집 파일: ve_lock.cpython-311.opt-1.pyc
� �EBg� � � � d dl Z d dlZd dlmZ dZej � ed� � Zdada G d� de � � Zdd�Zd � Z edd �� � ZdS )� N)�contextmanagerz/etc/containerz.ve.cfg.lockFc � � e Zd ZdS )�LockFailedExceptionN)�__name__� __module__�__qualname__� � �py/clveconfig/ve_lock.pyr r s � � � � � ��Dr r c � � t �dS | rda t t dd�� � a t j t � � � t j � � n"# t $ r}t d� � |�d }~ww xY wt � dd� � t � � � t � t t j � � � � � � t � � � dS )NFTza+zutf-8)�encodingz$IO error happened while getting lockr )�LOCK_FD� LOCK_WRITE�open� LOCK_FILE�fcntl�flock�fileno�LOCK_EX�IOErrorr �seek�truncate�write�str�os�getpid�flush)r �es r �setup_global_lockr s� � � ���u�� �� �Q��y�$��9�9�9�� ��G�N�N�$�$�e�m�4�4�4�4��� Q� Q� Q�!�"H�I�I�q�P�����Q�����L�L��A�����������M�M�#�b�i�k�k�"�"�#�#�#��M�M�O�O�O��4s �A A � A<�'A7�7A<c �` � t rdS t �t � � � d adS d S )NFT)r r �closer r r �release_lockr"