ž ¬ÿfƒ" c @ s d Z y d d l Z Wn e k r6 d d l Z Yn Xd d l m Z d d l m Z m Z y d d l m Z Wn" e k r• d d l m Z Yn Xd d d d d g Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z Gd d „ d ƒ Z Gd d „ d e ƒ Z Gd d „ d e ƒ Z d S( u' A multi-producer, multi-consumer queue.i N( u deque( u heappushu heappop( u monotonic( u timeu Emptyu Fullu Queueu PriorityQueueu LifoQueuec B s | Ee Z d Z d Z d S( u Emptyu4 Exception raised by Queue.get(block=0)/get_nowait().N( u __name__u __module__u __qualname__u __doc__( u __locals__( ( u* /opt/alt/python33/lib64/python3.3/queue.pyu Empty s c B s | Ee Z d Z d Z d S( u Fullu4 Exception raised by Queue.put(block=0)/put_nowait().N( u __name__u __module__u __qualname__u __doc__( u __locals__( ( u* /opt/alt/python33/lib64/python3.3/queue.pyu Full s c B sÑ | Ee Z d 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 d „ Z d d d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d S(! u Queueuj Create a queue object with a given maximum size. If maxsize is <= 0, the queue size is infinite. i c C sq | | _ | j | ƒ t j ƒ | _ t j | j ƒ | _ t j | j ƒ | _ t j | j ƒ | _ d | _ d S( Ni ( u maxsizeu _initu threadingu Locku mutexu Conditionu not_emptyu not_fullu all_tasks_doneu unfinished_tasks( u selfu maxsize( ( u* /opt/alt/python33/lib64/python3.3/queue.pyu __init__ s u Queue.__init__c C sa | j �R | j d } | d k rN | d k r> t d ƒ ‚ n | j j ƒ n | | _ Wd QXd S( u. Indicate that a formerly enqueued task is complete. Used by Queue consumer threads. For each get() used to fetch a task, a subsequent call to task_done() tells the queue that the processing on the task is complete. If a join() is currently blocking, it will resume when all items have been processed (meaning that a task_done() call was received for every item that had been put() into the queue). Raises a ValueError if called more times than there were items placed in the queue. i i u! task_done() called too many timesN( u all_tasks_doneu unfinished_tasksu ValueErroru notify_all( u selfu unfinished( ( u* /opt/alt/python33/lib64/python3.3/queue.pyu task_done5 s u Queue.task_donec C s1 | j �" x | j r&