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; |
8 |
+ |
|
9 |
|
import java.util.concurrent.*; |
10 |
|
|
11 |
|
/** |
15 |
|
* sometimes (using method {@link #transfer}) await receipt of |
16 |
|
* elements by consumers invoking {@code take} or {@code poll}, while |
17 |
|
* at other times enqueue elements (via method {@code put}) without |
18 |
< |
* waiting for receipt. {@linkplain |
19 |
< |
* #tryTransfer(Object) Non-blocking} and {@linkplain |
20 |
< |
* #tryTransfer(Object,long,TimeUnit) time-out} versions of {@code |
21 |
< |
* tryTransfer} are also available. A {@code TransferQueue} may also |
22 |
< |
* be queried, via {@link #hasWaitingConsumer}, whether there are any |
23 |
< |
* threads waiting for items, which is a converse analogy to a {@code |
24 |
< |
* peek} operation. |
18 |
> |
* waiting for receipt. |
19 |
> |
* {@linkplain #tryTransfer(Object) Non-blocking} and |
20 |
> |
* {@linkplain #tryTransfer(Object,long,TimeUnit) time-out} versions of |
21 |
> |
* {@code tryTransfer} are also available. |
22 |
> |
* A {@code TransferQueue} may also be queried, via {@link |
23 |
> |
* #hasWaitingConsumer}, whether there are any threads waiting for |
24 |
> |
* items, which is a converse analogy to a {@code peek} operation. |
25 |
|
* |
26 |
|
* <p>Like other blocking queues, a {@code TransferQueue} may be |
27 |
|
* capacity bounded. If so, an attempted transfer operation may |