Пример #1
0
 static {
   try {
     UNSAFE = UtilUnsafe.getUnsafe();
     Class k = TransferChannel.class;
     headOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("head"));
     tailOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("tail"));
     sweepVotesOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("sweepVotes"));
   } catch (Exception e) {
     throw new Error(e);
   }
 }
Пример #2
0
 static {
   try {
     UNSAFE = UtilUnsafe.getUnsafe();
     Class k = Node.class;
     itemOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("item"));
     saOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("sa"));
     nextOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("next"));
     waiterOffset = UNSAFE.objectFieldOffset(k.getDeclaredField("waiter"));
   } catch (Exception e) {
     throw new Error(e);
   }
 }