'Shutdown the thread pool.
Tasks may remain unexecuted in the submit queue.'

def Shutdown(self):

    while (not self.requeue.empty()):
        try:
            unused_item = self.requeue.get_nowait()
            self.requeue.task_done()
        except Queue.Empty:
            pass
    for thread in self.__threads:
        thread.exit_flag = True
        self.requeue.put(_THREAD_SHOULD_EXIT)
    self.__thread_gate.EnableAllThreads()
