Ñò Š„[Jc @ sˆ d Z d d k l Z d d k l Z d d k l Z d d d g Z d e f d „ ƒ YZ d e f d „ ƒ YZ d d d „ ƒ YZ d S( s« An adaptation of Py2.3/2.4's Queue module which supports reentrant behavior, using RLock instead of Lock for its mutex object. This is to support the connection pool's usage of weakref callbacks to return connections to the underlying Queue, which can apparently in extremely rare cases be invoked within the ``get()`` method of the Queue itself, producing a ``put()`` inside the ``get()`` and therefore a reentrant condition.iÿÿÿÿ( t deque( t time( t threadingt Emptyt Fullt Queuec B s e Z d Z RS( s4 Exception raised by Queue.get(block=0)/get_nowait().( t __name__t __module__t __doc__( ( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyR s c B s e Z d Z RS( s4 Exception raised by Queue.put(block=0)/put_nowait().( R R R ( ( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyR s c B s• e Z d d „ Z d „ Z d „ Z d „ Z e d d „ Z d „ Z e d d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( i c C sJ | i | ƒ t i ƒ | _ t i | i ƒ | _ t i | i ƒ | _ d S( sx Initialize a queue object with a given maximum size. If `maxsize` is <= 0, the queue size is infinite. N( t _initR t RLockt mutext Conditiont not_emptyt not_full( t selft maxsize( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyt __init__ s c C s* | i i ƒ | i ƒ } | i i ƒ | S( s9 Return the approximate size of the queue (not reliable!).( R t acquiret _qsizet release( R t n( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyt qsize. s c C s* | i i ƒ | i ƒ } | i i ƒ | S( sC Return True if the queue is empty, False otherwise (not reliable!).( R R t _emptyR ( R R ( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyt empty6 s c C s* | i i ƒ | i ƒ } | i i ƒ | S( sB Return True if the queue is full, False otherwise (not reliable!).( R R t _fullR ( R R ( ( s4 /usr/lib/python2.6/site-packages/sqlalchemy/queue.pyt full> s c C s | i i ƒ zæ | p | i ƒ o t ‚ qØ n§ | d j o&