def METHOD_NAME(self, g, entry):
    try:
        try:
            g.wait()
        except self.GreenletExit:
            entry.cancel()
            g.canceled = True
    finally:
        self._queue.discard(g)