@Override
    public boolean offer(E e)
    {
        if (null == e)
        {
            throw new NullPointerException();
        }
        //offer can fail only when backpressured, otherwise it retries
        final int positionOnCycleMask = this.positionOnCycleMask;
        final int cycleLengthLog2 = this.cycleLengthLog2;
        final int cycleLength = this.cycleLength;
        final int cycleIdBitShift = this.cycleIdBitShift;
        final AtomicReferenceArray<E> buffer = this.buffer;
        final AtomicLongArray producerCycleClaims = this.producerCycleClaim;
        final long maxCycleId = this.maxCycleId;
        final long maxPositionOnCycle = positionOnCycleMask;

        while (true)
        {
            final int activeCycle = activeCycleIndex(lvActiveCycleId());
            final long producerActiveCycleClaim = AtomicLongArrayAccess.lvValue(producerCycleClaims, activeCycle);
            final int positionOnActiveCycle = positionOnCycle(producerActiveCycleClaim, positionOnCycleMask);
            final long activeCycleId = cycleId(producerActiveCycleClaim, cycleIdBitShift);
            final long producerPosition = producerPosition(activeCycleId, positionOnActiveCycle, cycleLengthLog2);
            final long claimLimit = lvProducerLimit();
            if (producerPosition >= claimLimit)
            {
                //it is really backpressured?
                if (isBackPressured(producerPosition))
                {
                    return false;
                }
            }
            //try to claim on the active cycle
            final long producerCycleClaim =
                AtomicLongArrayAccess.getAndIncrementValue(producerCycleClaims, activeCycle);
            final int positionOnCycle = positionOnCycle(producerCycleClaim, positionOnCycleMask);
            if (positionOnCycle >= maxPositionOnCycle)
            {
                throw new IllegalStateException(
                    "too many over-claims: please enlarge the capacity or reduce the number of producers!");
            }
            if (positionOnCycle < cycleLength)
            {
                final long cycleId = cycleId(producerCycleClaim, cycleIdBitShift);
                if (cycleId != activeCycleId)
                {
                    validateSlowProducerClaim(cycleId, positionOnCycle, cycleLengthLog2);
                }
                //simplified operation to calculate the offset in the array: activeCycle hasn't changed from the beginning of the offer!
                final int producerOffset = calcElementOffset(activeCycle, positionOnCycle, cycleLengthLog2);
                buffer.lazySet(producerOffset, e);
                return true;
            }
            else if (positionOnCycle == cycleLength)
            {
                //is the only one responsible to rotate cycle: the other producers will be forced to wait until rotation got completed to perform a valid offer
                rotateCycle(producerCycleClaims, activeCycle, producerCycleClaim, cycleIdBitShift, maxCycleId);
            }
        }
    }
NOTE: This class was automatically generated by org.jctools.queues.atomic.JavaParsingAtomicArrayQueueGenerator
which can found in the jctools-build module. The original source file is MpscArrayQueue.java.
jctools-experimental/src/main/java/org/jctools/queues/atomic/MpscRelaxedAtomicArrayQueue.java