41 |
|
/** |
42 |
|
* Transfers the specified element immediately if there exists a |
43 |
|
* consumer already waiting to receive it (in {@link #take} or |
44 |
< |
* timed {@link #poll(Object,long,TimeUnit) poll}), otherwise |
45 |
< |
* returning {@code false} without enqueuing the element. |
44 |
> |
* timed {@link #poll(long,TimeUnit) poll}), otherwise returning |
45 |
> |
* {@code false} without enqueuing the element. |
46 |
|
* |
47 |
|
* @param e the element to transfer |
48 |
|
* @return {@code true} if the element was transferred, else |
99 |
|
/** |
100 |
|
* Returns {@code true} if there is at least one consumer waiting |
101 |
|
* to receive an element via {@link #take} or |
102 |
< |
* timed {@link #poll(Object,long,TimeUnit) poll}. |
102 |
> |
* timed {@link #poll(long,TimeUnit) poll}. |
103 |
|
* The return value represents a momentary state of affairs. |
104 |
|
* |
105 |
|
* @return {@code true} if there is at least one waiting consumer |
108 |
|
|
109 |
|
/** |
110 |
|
* Returns an estimate of the number of consumers waiting to |
111 |
< |
* receive elements via {@link #take} or |
112 |
< |
* timed {@link #poll(Object,long,TimeUnit) poll}. The return |
113 |
< |
* value is an approximation of a momentary state of affairs, that |
114 |
< |
* may be inaccurate if consumers have completed or given up |
115 |
< |
* waiting. The value may be useful for monitoring and heuristics, |
116 |
< |
* but not for synchronization control. Implementations of this |
111 |
> |
* receive elements via {@link #take} or timed |
112 |
> |
* {@link #poll(long,TimeUnit) poll}. The return value is an |
113 |
> |
* approximation of a momentary state of affairs, that may be |
114 |
> |
* inaccurate if consumers have completed or given up waiting. |
115 |
> |
* The value may be useful for monitoring and heuristics, but |
116 |
> |
* not for synchronization control. Implementations of this |
117 |
|
* method are likely to be noticeably slower than those for |
118 |
|
* {@link #hasWaitingConsumer}. |
119 |
|
* |