294 |
|
* @param e the comparison value for checking match |
295 |
|
* @param mode mode |
296 |
|
* @param nanos timeout value |
297 |
< |
* @return matched item, or s if cancelled |
297 |
> |
* @return matched item, or null if cancelled |
298 |
|
*/ |
299 |
|
private E awaitFulfill(Node<E> pred, Node<E> s, E e, |
300 |
|
int mode, long nanos) { |
360 |
|
for (;;) { |
361 |
|
Node<E> h = head.get(); |
362 |
|
Node<E> first = h.next; |
363 |
< |
if (first != null && first.next == first) { // help advance |
363 |
> |
if (first != null && first.get() == first) { // help advance |
364 |
|
advanceHead(h, first); |
365 |
|
continue; |
366 |
|
} |
511 |
|
|
512 |
|
/** |
513 |
|
* Inserts the specified element at the tail of this queue. |
514 |
< |
* As the queue is unbounded this method will never throw |
514 |
> |
* As the queue is unbounded, this method will never throw |
515 |
|
* {@link IllegalStateException} or return {@code false}. |
516 |
|
* |
517 |
|
* @return {@code true} (as specified by {@link Collection#add}) |
522 |
|
} |
523 |
|
|
524 |
|
/** |
525 |
< |
* Transfers the specified element immediately if there exists a |
526 |
< |
* consumer already waiting to receive it (in {@link #take} or |
527 |
< |
* timed {@link #poll(long,TimeUnit) poll}), otherwise |
528 |
< |
* returning {@code false} without enqueuing the element. |
525 |
> |
* Transfers the element to a waiting consumer immediately, if possible. |
526 |
> |
* |
527 |
> |
* <p>More precisely, transfers the specified element immediately |
528 |
> |
* if there exists a consumer already waiting to receive it (in |
529 |
> |
* {@link #take} or timed {@link #poll(long,TimeUnit) poll}), |
530 |
> |
* otherwise returning {@code false} without enqueuing the element. |
531 |
|
* |
532 |
|
* @throws NullPointerException if the specified element is null |
533 |
|
*/ |
537 |
|
} |
538 |
|
|
539 |
|
/** |
540 |
< |
* Inserts the specified element at the tail of this queue, |
541 |
< |
* waiting if necessary for the element to be received by a |
542 |
< |
* consumer invoking {@code take} or {@code poll}. |
540 |
> |
* Transfers the element to a consumer, waiting if necessary to do so. |
541 |
> |
* |
542 |
> |
* <p>More precisely, transfers the specified element immediately |
543 |
> |
* if there exists a consumer already waiting to receive it (in |
544 |
> |
* {@link #take} or timed {@link #poll(long,TimeUnit) poll}), |
545 |
> |
* else inserts the specified element at the tail of this queue |
546 |
> |
* and waits until the element is received by a consumer. |
547 |
|
* |
548 |
|
* @throws NullPointerException if the specified element is null |
549 |
|
*/ |
556 |
|
} |
557 |
|
|
558 |
|
/** |
559 |
< |
* Inserts the specified element at the tail of this queue, |
560 |
< |
* waiting up to the specified wait time for the element to be |
561 |
< |
* received by a consumer invoking {@code take} or {@code poll}. |
559 |
> |
* Transfers the element to a consumer if it is possible to do so |
560 |
> |
* before the timeout elapses. |
561 |
> |
* |
562 |
> |
* <p>More precisely, transfers the specified element immediately |
563 |
> |
* if there exists a consumer already waiting to receive it (in |
564 |
> |
* {@link #take} or timed {@link #poll(long,TimeUnit) poll}), |
565 |
> |
* else inserts the specified element at the tail of this queue |
566 |
> |
* and waits until the element is received by a consumer, |
567 |
> |
* returning {@code false} if the specified wait time elapses |
568 |
> |
* before the element can be transferred. |
569 |
|
* |
570 |
|
* @throws NullPointerException if the specified element is null |
571 |
|
*/ |