114 |
|
this.isData = isData; |
115 |
|
} |
116 |
|
|
117 |
+ |
// Unsafe mechanics |
118 |
+ |
|
119 |
+ |
private static final sun.misc.Unsafe UNSAFE = getUnsafe(); |
120 |
+ |
private static final long nextOffset = |
121 |
+ |
objectFieldOffset(UNSAFE, "next", Node.class); |
122 |
+ |
|
123 |
|
final boolean casNext(Node<E> cmp, Node<E> val) { |
124 |
|
return UNSAFE.compareAndSwapObject(this, nextOffset, cmp, val); |
125 |
|
} |
128 |
|
UNSAFE.putOrderedObject(this, nextOffset, this); |
129 |
|
} |
130 |
|
|
125 |
– |
// Unsafe mechanics |
126 |
– |
|
127 |
– |
private static final sun.misc.Unsafe UNSAFE = getUnsafe(); |
128 |
– |
private static final long nextOffset = |
129 |
– |
objectFieldOffset(UNSAFE, "next", Node.class); |
130 |
– |
|
131 |
|
/** |
132 |
|
* Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package. |
133 |
|
* Replace with a simple call to Unsafe.getUnsafe when integrating |