def InterruptibleQueueJoin(queue, thread_local, thread_pool, queue_join_thread_factory=QueueJoinThread, check_workers=True):
 thread = queue_join_thread_factory(queue)
 thread.start()
 while True:
  thread.join(timeout=0.5)
  if (not thread.isAlive()):
   return True
  if thread_local.shut_down:
   logger.debug('Queue join interrupted')
   return False
  if check_workers:
   for worker_thread in thread_pool.Threads():
    if (not worker_thread.isAlive()):
     return False

def InterruptibleQueueJoin ( queue , thread_local , thread_pool , queue_join_thread_factory = QueueJoinThread , check_workers = True ) : thread = queue_join_thread_factory ( queue ) thread . start ( ) while True : thread . join ( timeout = 0.5 ) if ( not thread . isAlive ( ) ) : return True if thread_local . shut_down : logger . debug ( 'Queue join interrupted' ) return False if check_workers : for worker_thread in thread_pool . Threads ( ) : if ( not worker_thread . isAlive ( ) ) : return False
repeatedly joins the given requeue or queue .