548 |
|
* @throws InterruptedException {@inheritDoc} |
549 |
|
*/ |
550 |
|
public E take() throws InterruptedException { |
551 |
< |
Object e = xfer(null, WAIT, 0); |
551 |
> |
E e = xfer(null, WAIT, 0); |
552 |
|
if (e != null) |
553 |
< |
return (E) e; |
553 |
> |
return e; |
554 |
|
Thread.interrupted(); |
555 |
|
throw new InterruptedException(); |
556 |
|
} |
559 |
|
* @throws InterruptedException {@inheritDoc} |
560 |
|
*/ |
561 |
|
public E poll(long timeout, TimeUnit unit) throws InterruptedException { |
562 |
< |
Object e = xfer(null, TIMEOUT, unit.toNanos(timeout)); |
562 |
> |
E e = xfer(null, TIMEOUT, unit.toNanos(timeout)); |
563 |
|
if (e != null || !Thread.interrupted()) |
564 |
< |
return (E) e; |
564 |
> |
return e; |
565 |
|
throw new InterruptedException(); |
566 |
|
} |
567 |
|
|
667 |
|
E item = nextItem; |
668 |
|
|
669 |
|
for (;;) { |
670 |
< |
pnext = next == null ? traversalHead() : next; |
670 |
> |
pnext = (next == null) ? traversalHead() : next; |
671 |
|
next = pnext.next; |
672 |
|
if (next == pnext) { |
673 |
|
next = null; |