관리-도구
편집 파일: queue.cpython-37.opt-2.pyc
B YI~d_, � @ s� d dl Z d dlmZ d dlmZmZ d dlmZ yd dlm Z W n e k rX dZ Y nX dddd d dgZyd dlmZ W n$ e k r� G d d� de�ZY nX G dd� de�ZG dd� d�ZG dd � d e�ZG dd � d e�ZG dd� d�Ze dkr�eZ dS )� N)�deque)�heappush�heappop)� monotonic)�SimpleQueue�Empty�Full�Queue� PriorityQueue� LifoQueuer )r c @ s e Zd ZdS )r N)�__name__� __module__�__qualname__� r r �*/opt/alt/python37/lib64/python3.7/queue.pyr s c @ s e Zd ZdS )r N)r r r r r r r r s c @ s� e Zd Zd dd�Zdd� Zdd� Zdd � Zd d� Zdd � Zd!dd�Z d"dd�Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� ZdS )#r r c C sN || _ | �|� t�� | _t�| j�| _t�| j�| _t�| j�| _d| _ d S )Nr ) �maxsize�_init� threadingZLock�mutexZ Condition� not_empty�not_full�all_tasks_done�unfinished_tasks)�selfr r r r �__init__! s zQueue.__init__c C sH | j �8 | jd }|dkr4|dk r*td��| j �� || _W d Q R X d S )N� r z!task_done() called too many times)r r � ValueErrorZ notify_all)r Z unfinishedr r r � task_done8 s zQueue.task_donec C s, | j � x| jr| j �� q W W d Q R X d S )N)r r �wait)r r r r �joinN s z Queue.joinc C s | j � | �� S Q R X d S )N)r �_qsize)r r r r �qsize[ s zQueue.qsizec C s | j � | �� S Q R X d S )N)r r )r r r r �empty` s zQueue.emptyc C s0 | j � d| j k o | �� kS S Q R X d S )Nr )r r r )r r r r �fulln s z Queue.fullTNc C s� | j �� | jdkr�|s*| �� | jkr�t�nz|d krRxp| �� | jkrN| j �� q4W nR|dk rdtd��n@t� | }x4| �� | jkr�|t� }|dkr�t�| j �|� qpW | �|� | jd7 _| j � � W d Q R X d S )Nr z''timeout' must be a non-negative numberg r )r r r r r r �time�_putr r �notify)r �item�block�timeout�endtime� remainingr r r �puty s&