479 |
|
private static final int SYNC = 2; // for transfer, take |
480 |
|
private static final int TIMEOUT = 3; // for timed poll, tryTransfer |
481 |
|
|
482 |
+ |
@SuppressWarnings("unchecked") |
483 |
+ |
static <E> E cast(Object item) { |
484 |
+ |
assert item == null || item.getClass() != Node.class; |
485 |
+ |
return (E) item; |
486 |
+ |
} |
487 |
+ |
|
488 |
|
/** |
489 |
|
* Implements all queuing methods. See above for explanation. |
490 |
|
* |
689 |
|
return null; |
690 |
|
} |
691 |
|
|
686 |
– |
@SuppressWarnings("unchecked") |
687 |
– |
static <E> E cast(Object item) { |
688 |
– |
assert item.getClass() != Node.class; |
689 |
– |
return (E) item; |
690 |
– |
} |
691 |
– |
|
692 |
|
/** |
693 |
|
* Returns the item in the first unmatched node with isData; or |
694 |
|
* null if none. Used by peek. |