def METHOD_NAME(self):
    """
    Terminates all threads
    """
    # Don't change order without looking at BaseWorkerThread!
    # Notify all threads to terminate
    self.terminateSlaves.set()
    self.pauseSlaves.clear()
    self.resumeSlaves.set()
    # Wait for all threads to finished
    finished = False
    while not finished:
        self.lock.acquire()
        logging.info("Waiting for %s worker threads to terminate", self.activeThreadCount)
        logging.debug("\n slavelist is %s", self.slavelist)
        logging.debug("\n threadlist is %s", threading.enumerate())
        if self.activeThreadCount == 0:
            finished = True
        else:
            # check to make sure we aren't waiting on dead threads
            threadlist = threading.enumerate()
            # we want to look for all the slavenames
            #  that correspond to nonexistant or dead threads
            # also, I realize this is O(N^2), but my brain hurts too hard
            #  to do it nicer
            # this (should be) race-proof. my thoughts:
            #  this is in a lock, the only other places that modify
            #  activeThreadCount are within locks
            # everywhere else that tries to modify active thread count
            # also does it with a try-except-else around removing from
            # slavelist. Slavelist becomes our synchronization
            for slavename in self.slavelist:
                found = False
                for threadobj in threadlist:
                    if hasattr(threadobj, 'name') and (slavename == threadobj.name) and (threadobj.is_alive()):
                        found = True
                if found is False:
                    # the slave we wanted wasn't running
                    try:
                        self.slavelist.remove(slavename)
                    except Exception as ex:
                        print("couldn't remove thread.. %s " % ex)
                    else:
                        self.activeThreadCount -= 1
        self.lock.release()
        time.sleep(5)
    logging.info("All worker threads terminated")