Пример #1
0
 static {
   try {
     C_INDEX_OFFSET =
         PlatformDependent0.UNSAFE.objectFieldOffset(
             MpscArrayQueueConsumerField.class.getDeclaredField("consumerIndex"));
   } catch (NoSuchFieldException e) {
     throw new RuntimeException(e);
   }
 }
Пример #2
0
 protected void soConsumerIndex(long l) {
   PlatformDependent0.UNSAFE.putOrderedLong(this, C_INDEX_OFFSET, l);
 }
Пример #3
0
 protected final boolean casProducerIndex(long expect, long newValue) {
   return PlatformDependent0.UNSAFE.compareAndSwapLong(this, P_INDEX_OFFSET, expect, newValue);
 }