multitables.py
def get(self):
        """
        Fetch the next item in the queue. Blocks until an item is ready.
        :return: The next unsigned integer in the queue.
        """
        with self.cvar:
            while True:
                if self.size.value > 0:
                    rval = self.vals[self.tail.value]
                    self.tail.value = (self.tail.value + 1) % len(self.vals)
                    self.size.value -= 1
                    if rval == -2:
                        return QueueClosed
                    assert(rval >= 0)
                    return rval
                self.cvar.wait()
def get(self):
        """
        Fetch the next item in the queue. Blocks until an item is ready.
        :return: The next unsigned integer in the queue.
        """
        with self.cvar:
            while True:
                if self.size.value > 0:
                    rval = self.vals[self.tail.value]
                    self.tail.value = (self.tail.value + 1) % len(self.vals)
                    self.size.value -= 1
                    if rval == -2:
                        return QueueClosed
                    assert(rval >= 0)
                    return rval
                self.cvar.wait()
Fetch the next item in the queue. Blocks until an item is ready.
        :return: The next unsigned integer in the queue.