'Checks to see if any threads are still working and
blocks until worker threads all complete.'

def wait(self):

    for x in xrange(self.numthreads):
        self.queue.put('die')
    dead = 0
    while True:
        try:
            thread = self.threads.get(block=True, timeout=1)
            if thread.isAlive():
                thread.join()
            dead += 1
        except Queue.Empty:
            assert (dead == self.numthreads)
            return
