private synchronized void scheduleAt(Entry entry, long expireAtMillis) {
        if (entry.next != null) {
            linkOut(entry);
        }
        long delayMillis = expireAtMillis - nextTick;
        if (delayMillis < 0) {
            entry.slot = NUM_SLOTS;
            entry.iter = 0;
        } else {
            long ticks = 1 + (int)((delayMillis + MILLIS_PER_SLOT / 2) / MILLIS_PER_SLOT);
            entry.slot = (int)((ticks + currSlot) & SLOT_MASK);
            entry.iter = currIter + (int)((ticks + currSlot) >> ITER_SHIFT);
        }
        linkIn(entry);
    }
@author <a href="mailto:havardpe@yahoo-inc.com">Haavard Pettersen</a>
@author Simon Thoresen Hult
jdisc_core/src/main/java/com/yahoo/jdisc/core/ScheduledQueue.java