synchronized DispData getDisplayData() throws InterruptedException {
        freeCounterIndex = -1;

        while (freeCounterIndex < 0) {
            if (waitNumber > serveNumber) {
                int i = 0;
                while (freeCounterIndex < 0 && i < nCounters) {
                    if (freeCounter[i]) {
                        freeCounterIndex = i;
                        i = nCounters;
                    } else {
                        i++;
                    }
                }
            }

            if (freeCounterIndex < 0) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    throw new RTInterrupted(e);
                }
            }
        }

        freeCounter[freeCounterIndex] = false;

        displayData.counter = freeCounterIndex;
        displayData.ticket = ++serveNumber;

        return displayData;
	}