
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,a\,  ã                   @   sü   d dl Z d dlmZ d dlmZmZ d dlmZ zd dlm	Z	 W n e
k
rX   dZ	Y nX dddd	d
dgZzd dlmZ W n$ e
k
rž   G dd„ deƒZY nX G dd„ deƒZG dd„ dƒZG dd	„ d	eƒZG dd
„ d
eƒZG dd„ dƒZe	dkrøeZ	dS )é    N)Údeque)ÚheappushÚheappop)Ú	monotonic)ÚSimpleQueueÚEmptyÚFullÚQueueÚPriorityQueueÚ	LifoQueuer   )r   c                   @   s   e Zd ZdS )r   N©Ú__name__Ú
__module__Ú__qualname__© r   r   ú*/opt/alt/python38/lib64/python3.8/queue.pyr      s   c                   @   s   e Zd ZdS )r   Nr   r   r   r   r   r      s   c                   @   s‚   e Zd Zd dd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Zd!dd„Z	d"dd„Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )#r	   r   c                 C   sN   || _ |  |¡ t ¡ | _t | j¡| _t | j¡| _t | j¡| _d| _	d S ©Nr   )
ÚmaxsizeÚ_initÚ	threadingZLockÚmutexZ	ConditionÚ	not_emptyÚnot_fullÚall_tasks_doneÚunfinished_tasks©Úselfr   r   r   r   Ú__init__!   s    

zQueue.__init__c              	   C   sH   | j �8 | jd }|dkr4|dk r*tdƒ‚| j  ¡  || _W 5 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    

zQueue.task_donec              	   C   s(   | j � | jr| j  ¡  qW 5 Q R X d S ©N)r   r   Úwait©r   r   r   r   ÚjoinN   s    	z
Queue.joinc              
   C   s&   | j � |  ¡ W  5 Q R £ S Q R X d S r!   ©r   Ú_qsizer#   r   r   r   Úqsize[   s    zQueue.qsizec              
   C   s(   | j � |  ¡  W  5 Q R £ S Q R X d S r!   r%   r#   r   r   r   Úempty`   s    zQueue.emptyc              
   C   s<   | j �, d| j  k o |  ¡ kn  W  5 Q R £ S Q R X d S r   )r   r   r&   r#   r   r   r   Úfulln   s    z
Queue.fullTNc              	   C   sÌ   | j �¼ | jdkrœ|s*|  ¡ | jkrœt‚nr|d krN|  ¡ | jkrœ| j  ¡  q2nN|dk r`tdƒ‚n<tƒ | }|  ¡ | jkrœ|tƒ  }|dkrŽt‚| j  |¡ qj|  |¡ |  jd7  _| j	 
¡  W 5 Q R X d S )Nr   ú''timeout' must be a non-negative numberç        r   )r   r   r&   r   r"   r   ÚtimeÚ_putr   r   Únotify)r   ÚitemÚblockÚtimeoutÚendtimeÚ	remainingr   r   r   Úputy   s&    




z	Queue.putc              
   C   s¬   | j �œ |s|  ¡ s€t‚nf|d kr8|  ¡ s€| j  ¡  q"nH|dk rJtdƒ‚n6tƒ | }|  ¡ s€|tƒ  }|dkrrt‚| j  |¡ qT|  ¡ }| j ¡  |W  5 Q R £ S Q R X d S )Nr   r*   r+   )	r   r&   r   r"   r   r,   Ú_getr   r.   )r   r0   r1   r2   r3   r/   r   r   r   Úget™   s$    



z	Queue.getc                 C   s   | j |dd�S ©NF)r0   ©r4   ©r   r/   r   r   r   Ú
put_nowait¸   s    zQueue.put_nowaitc                 C   s   | j dd�S r7   ©r6   r#   r   r   r   Ú
get_nowaitÀ   s    zQueue.get_nowaitc                 C   s   t ƒ | _d S r!   )r   Úqueuer   r   r   r   r   Í   s    zQueue._initc                 C   s
   t | jƒS r!   ©Úlenr=   r#   r   r   r   r&   Ð   s    zQueue._qsizec                 C   s   | j  |¡ d S r!   ©r=   Úappendr9   r   r   r   r-   Ô   s    z
Queue._putc                 C   s
   | j  ¡ S r!   )r=   Úpopleftr#   r   r   r   r5   Ø   s    z
Queue._get)r   )TN)TN)r   r   r   r   r    r$   r'   r(   r)   r4   r6   r:   r<   r   r&   r-   r5   r   r   r   r   r	      s   

 
c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
r
   c                 C   s
   g | _ d S r!   ©r=   r   r   r   r   r   â   s    zPriorityQueue._initc                 C   s
   t | jƒS r!   r>   r#   r   r   r   r&   å   s    zPriorityQueue._qsizec                 C   s   t | j|ƒ d S r!   )r   r=   r9   r   r   r   r-   è   s    zPriorityQueue._putc                 C   s
   t | jƒS r!   )r   r=   r#   r   r   r   r5   ë   s    zPriorityQueue._getN©r   r   r   r   r&   r-   r5   r   r   r   r   r
   Ü   s   c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
r   c                 C   s
   g | _ d S r!   rC   r   r   r   r   r   ò   s    zLifoQueue._initc                 C   s
   t | jƒS r!   r>   r#   r   r   r   r&   õ   s    zLifoQueue._qsizec                 C   s   | j  |¡ d S r!   r@   r9   r   r   r   r-   ø   s    zLifoQueue._putc                 C   s
   | j  ¡ S r!   )r=   Úpopr#   r   r   r   r5   û   s    zLifoQueue._getNrD   r   r   r   r   r   ï   s   c                   @   sH   e Zd Zdd„ Zddd„Zddd„Zd	d
„ Zdd„ Zdd„ Zdd„ Z	dS )Ú_PySimpleQueuec                 C   s   t ƒ | _t d¡| _d S r   )r   Ú_queuer   Z	SemaphoreÚ_countr#   r   r   r   r   	  s    z_PySimpleQueue.__init__TNc                 C   s   | j  |¡ | j ¡  d S r!   )rG   rA   rH   Úrelease)r   r/   r0   r1   r   r   r   r4     s    z_PySimpleQueue.putc                 C   s4   |d k	r|dk rt dƒ‚| j ||¡s*t‚| j ¡ S )Nr   r*   )r   rH   Úacquirer   rG   rB   )r   r0   r1   r   r   r   r6     s
    z_PySimpleQueue.getc                 C   s   | j |dd�S r7   r8   r9   r   r   r   r:   '  s    z_PySimpleQueue.put_nowaitc                 C   s   | j dd�S r7   r;   r#   r   r   r   r<   /  s    z_PySimpleQueue.get_nowaitc                 C   s   t | jƒdkS r   ©r?   rG   r#   r   r   r   r(   7  s    z_PySimpleQueue.emptyc                 C   s
   t | jƒS r!   rK   r#   r   r   r   r'   ;  s    z_PySimpleQueue.qsize)TN)TN)
r   r   r   r   r4   r6   r:   r<   r(   r'   r   r   r   r   rF   ÿ   s   

	
rF   )r   Úcollectionsr   Úheapqr   r   r,   r   rG   r   ÚImportErrorÚ__all__r   Ú	Exceptionr   r	   r
   r   rF   r   r   r   r   Ú<module>   s(   
 BA