'Remove and return the first items for which predicate is True,
ignoring delay.'

def remove(self, predicate):

    try:
        self._lock.acquire()
        for (i, (elem, t)) in enumerate(self._queue):
            if predicate(elem):
                del self._queue[i]
                return elem
    finally:
        self._lock.release()
    return None
