Ejemplo n.º 1
0
        private void waitForFreeSlotAt(long sequence, Sequence[] dependentSequences, MutableLong minGatingSequence)
        {
            long wrapPoint = sequence - bufferSize;
            if (wrapPoint > minGatingSequence.get())
            {
            long minSequence;
            while (wrapPoint > (minSequence = Util.getMinimumSequence(dependentSequences)))
            {
                LockSupport.parkNanos(1000L);
            }

            minGatingSequence.set(minSequence);
            }
        }
Ejemplo n.º 2
0
        private void waitForCapacity(Sequence[] dependentSequences,  MutableLong minGatingSequence)
        {
            long wrapPoint = (claimSequence.get() + 1L) - bufferSize;
            if (wrapPoint > minGatingSequence.get())
            {
            long minSequence;
            while (wrapPoint > (minSequence = Util.getMinimumSequence(dependentSequences)))
            {
                LockSupport.parkNanos(1000L);
            }

            minGatingSequence.set(minSequence);
            }
        }