%PDF- %PDF-
Direktori : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/lock.cpython-312.pyc |
� �~�e� � �: � d dl Z d dlZd dlZ G d� de� Zdd�Zy)� Nc � � e Zd ZdZy)� LockErrorz"Raised when unable to lock a file.N)�__name__� __module__�__qualname__�__doc__� � �4/usr/lib/python3/dist-packages/landscape/lib/lock.pyr r s � �,r r c �@ �� t j | t j � �t j �t j d� }|t j z }t j �t j |� t j � } t j �t j t j z � �fd�}|S # t $ r( |t j � |z k rt d� �Y nw xY wt j d� ��)Nr zCouldn't obtain lockg�������?c �x �� t j � t j � t j � � y )N)�fcntl�flock�LOCK_UN�os�close)�fds �r �unlock_pathzlock_path.<locals>.unlock_path s �� � ���B�� � �&� ����r )r �open�O_CREATr �F_GETFD� FD_CLOEXEC�F_SETFD�timer �LOCK_EX�LOCK_NB�OSErrorr �sleep)�path�timeout�flags�startedr r s @r � lock_pathr# s� �� � ����r�z�z� "�B��K�K��E�M�M�1�-�E� �U� � ��E� �K�K��E�M�M�5�)��i�i�k�G� � ��K�K��E�M�M�E�M�M�9�:� �� ��� � 8������w�.�.�� 6�7�7� /� 8�� � � �3�� s �5C �.D�D)r )r r r � Exceptionr r# r r r �<module>r% s �� � � �-� � -�r