260 |
|
|
261 |
|
/** The head (top) of the stack */ |
262 |
|
volatile SNode head; |
263 |
< |
|
263 |
> |
|
264 |
|
boolean casHead(SNode h, SNode nh) { |
265 |
< |
return h == head && |
265 |
> |
return h == head && |
266 |
|
UNSAFE.compareAndSwapObject(this, headOffset, h, nh); |
267 |
|
} |
268 |
|
|
514 |
|
void tryCancel(Object cmp) { |
515 |
|
UNSAFE.compareAndSwapObject(this, itemOffset, cmp, this); |
516 |
|
} |
517 |
< |
|
517 |
> |
|
518 |
|
boolean isCancelled() { |
519 |
|
return item == this; |
520 |
|
} |
558 |
|
* old head's next node to avoid garbage retention. |
559 |
|
*/ |
560 |
|
void advanceHead(QNode h, QNode nh) { |
561 |
< |
if (h == head && |
561 |
> |
if (h == head && |
562 |
|
UNSAFE.compareAndSwapObject(this, headOffset, h, nh)) |
563 |
|
h.next = h; // forget old next |
564 |
|
} |
770 |
|
objectFieldOffset(UNSAFE, "tail", TransferQueue.class); |
771 |
|
private static final long cleanMeOffset = |
772 |
|
objectFieldOffset(UNSAFE, "cleanMe", TransferQueue.class); |
773 |
< |
|
773 |
> |
|
774 |
|
} |
775 |
|
|
776 |
|
/** |