public void setBit(int index) {
        logger.debug("bit {}", index);
        while (true) {
            int map = bits.get();
            if (bits.compareAndSet(map, map | (1 << index))) {
                if (map == 0) {
                    synchronized (lock) {
                        logger.debug("notify map not zero {}", index);
                        lock.notify();
                    }
                }
                break;
            }
        }
    }