def _invalidate_queue(q, val=None, sync=True):
 def _qsize(len=len):
  return 1
 def _put(item):
  pass
 def _get():
  return val
 if sync:
  q.mutex.acquire()
 try:
  q.maxsize = 0
  q._qsize = _qsize
  q._put = _put
  q._get = _get
  q.not_empty.notifyAll()
  q.not_full.notifyAll()
 finally:
  if sync:
   q.mutex.release()

def _invalidate_queue ( q , val = None , sync = True ) : def _qsize ( len = len ) : return 1 def _put ( item ) : pass def _get ( ) : return val if sync : q . mutex . acquire ( ) try : q . maxsize = 0 q . _qsize = _qsize q . _put = _put q . _get = _get q . not_empty . notifyAll ( ) q . not_full . notifyAll ( ) finally : if sync : q . mutex . release ( )
breaks a queue such that it never blocks .