1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166y; |
14 |
|
* sometimes (using method {@link #transfer}) await receipt of |
15 |
|
* elements by consumers invoking {@code take} or {@code poll}, while |
16 |
|
* at other times enqueue elements (via method {@code put}) without |
17 |
< |
* waiting for receipt. {@linkplain |
18 |
< |
* #tryTransfer(Object) Non-blocking} and {@linkplain |
19 |
< |
* #tryTransfer(Object,long,TimeUnit) time-out} versions of {@code |
20 |
< |
* tryTransfer} are also available. A {@code TransferQueue} may also |
21 |
< |
* be queried, via {@link #hasWaitingConsumer}, whether there are any |
22 |
< |
* threads waiting for items, which is a converse analogy to a {@code |
23 |
< |
* peek} operation. |
17 |
> |
* waiting for receipt. |
18 |
> |
* {@linkplain #tryTransfer(Object) Non-blocking} and |
19 |
> |
* {@linkplain #tryTransfer(Object,long,TimeUnit) time-out} versions of |
20 |
> |
* {@code tryTransfer} are also available. |
21 |
> |
* A {@code TransferQueue} may also be queried, via {@link |
22 |
> |
* #hasWaitingConsumer}, whether there are any threads waiting for |
23 |
> |
* items, which is a converse analogy to a {@code peek} operation. |
24 |
|
* |
25 |
|
* <p>Like other blocking queues, a {@code TransferQueue} may be |
26 |
< |
* capacity bounded. If so, an attempted {@code transfer} operation |
27 |
< |
* may initially block waiting for available space, and/or |
28 |
< |
* subsequently block waiting for reception by a consumer. Note that |
29 |
< |
* in a queue with zero capacity, such as {@link SynchronousQueue}, |
30 |
< |
* {@code put} and {@code transfer} are effectively synonymous. |
26 |
> |
* capacity bounded. If so, an attempted transfer operation may |
27 |
> |
* initially block waiting for available space, and/or subsequently |
28 |
> |
* block waiting for reception by a consumer. Note that in a queue |
29 |
> |
* with zero capacity, such as {@link SynchronousQueue}, {@code put} |
30 |
> |
* and {@code transfer} are effectively synonymous. |
31 |
|
* |
32 |
|
* <p>This interface is a member of the |
33 |
|
* <a href="{@docRoot}/../technotes/guides/collections/index.html"> |