ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/TransferQueue.java
(Generate patch)

Comparing jsr166/src/jsr166y/TransferQueue.java (file contents):
Revision 1.6 by jsr166, Mon Jul 27 00:01:47 2009 UTC vs.
Revision 1.7 by jsr166, Thu Jul 30 22:45:39 2009 UTC

# Line 39 | Line 39 | import java.util.concurrent.*;
39   */
40   public interface TransferQueue<E> extends BlockingQueue<E> {
41      /**
42 <     * Transfers the specified element if there exists a consumer
43 <     * already waiting to receive it, otherwise returning {@code false}
44 <     * without enqueuing the element.
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.
46       *
47       * @param e the element to transfer
48       * @return {@code true} if the element was transferred, else
# Line 57 | Line 58 | public interface TransferQueue<E> extend
58      /**
59       * Inserts the specified element into this queue, waiting if
60       * necessary for space to become available and the element to be
61 <     * dequeued by a consumer invoking {@code take} or {@code poll}.
61 >     * received by a consumer invoking {@code take} or {@code poll}.
62       *
63       * @param e the element to transfer
64       * @throws InterruptedException if interrupted while waiting,
# Line 73 | Line 74 | public interface TransferQueue<E> extend
74      /**
75       * Inserts the specified element into this queue, waiting up to
76       * the specified wait time if necessary for space to become
77 <     * available and the element to be dequeued by a consumer invoking
77 >     * available and the element to be received by a consumer invoking
78       * {@code take} or {@code poll}.
79       *
80       * @param e the element to transfer
# Line 97 | Line 98 | public interface TransferQueue<E> extend
98  
99      /**
100       * Returns {@code true} if there is at least one consumer waiting
101 <     * to dequeue an element via {@code take} or {@code poll}.
101 >     * to receive an element via {@link #take} or
102 >     * timed {@link #poll(Object,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
# Line 106 | Line 108 | public interface TransferQueue<E> extend
108  
109      /**
110       * Returns an estimate of the number of consumers waiting to
111 <     * dequeue elements via {@code take} or {@code poll}. The return
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,
# Line 114 | Line 117 | public interface TransferQueue<E> extend
117       * method are likely to be noticeably slower than those for
118       * {@link #hasWaitingConsumer}.
119       *
120 <     * @return the number of consumers waiting to dequeue elements
120 >     * @return the number of consumers waiting to receive elements
121       */
122      int getWaitingConsumerCount();
123   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines