| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/mercurial/__pycache__/ |
Upload File : |
a
�+�b� � @ sd d dl mZ d dlZd dlZd dlZddlmZmZmZm Z m
Z
G dd� de�Zdd� Z
d d
� ZdS )� )�absolute_importN� )�error�hg�obsolete�scmutil�utilc @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dS )�
repoloaderz�Load repositories in background thread
This is designed for a forking server. A cached repo cannot be obtained
until the server fork()s a worker and the loader thread stops.
c C s@ |� � | _tj|d�| _tj|d�| _d| _t �
� | _d | _d S )N)�max)�maxlenF)
�copy�_uir Zlrucachedict�_cache�collections�deque�_inqueue�
_accepting� threading�Event� _newentry�_thread)�self�uir � r �9/usr/lib64/python3.9/site-packages/mercurial/repocache.py�__init__ s
zrepoloader.__init__c C s4 | j jdkrd S d| _tj| jd�| _| j�� d S )Nr T)�target)r r r r �Thread� _mainloopr �start�r r r r r ( s
zrepoloader.startc C sB | j s
d S d| _| j�� | j �� d | _ | j�� | j�� d S )NF)r r r �set�joinr �clearr r r r r �stop1 s
zrepoloader.stopc C s | j �|� | j�� dS )z6Request to load the specified repository in backgroundN)r �appendr r! �r �pathr r r �load; s zrepoloader.loadc C s( | j r| j �� rt�d��| j�|d�S )z�Return a cached repo if available
This function must be called after fork(), where the loader thread
is stopped. Otherwise, the returned repo might be updated by the
loader thread.
s0 cannot obtain cached repo while loader is activeN)r �is_aliver ZProgrammingErrorr �peekr&