'Shut down the thread at the next chance possible.'

def abort(self):

    with self.abort_lock:
        self.abort_flag = True
        if hasattr(self, 'in_queue'):
            _invalidate_queue(self.in_queue, POISON)
        if hasattr(self, 'out_queue'):
            _invalidate_queue(self.out_queue, POISON)
