'Initialize a WorkerThread instance.
Args:
thread_pool: An AdaptiveThreadPool instance.
thread_gate: A ThreadGate instance.
name: A name for this WorkerThread.'

def __init__(self, thread_pool, thread_gate, name=None):

    threading.Thread.__init__(self)
    self.setDaemon(True)
    self.exit_flag = False
    self.__error = None
    self.__traceback = None
    self.__thread_pool = thread_pool
    self.__work_queue = thread_pool.requeue
    self.__thread_gate = thread_gate
    if (not name):
        self.__name = ('Anonymous_' + self.__class__.__name__)
    else:
        self.__name = name
