ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/LinkedBlockingQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/LinkedBlockingQueue.java (file contents):
Revision 1.39 by dl, Tue Jan 11 00:43:21 2005 UTC vs.
Revision 1.40 by jsr166, Tue Apr 26 01:17:18 2005 UTC

# Line 40 | Line 40 | import java.util.*;
40   * @author Doug Lea
41   * @param <E> the type of elements held in this collection
42   *
43 < **/
43 > */
44   public class LinkedBlockingQueue<E> extends AbstractQueue<E>
45          implements BlockingQueue<E>, java.io.Serializable {
46      private static final long serialVersionUID = -6903933977591709194L;
# Line 94 | Line 94 | public class LinkedBlockingQueue<E> exte
94      private final Condition notFull = putLock.newCondition();
95  
96      /**
97 <     * Signal a waiting take. Called only from put/offer (which do not
97 >     * Signals a waiting take. Called only from put/offer (which do not
98       * otherwise ordinarily lock takeLock.)
99       */
100      private void signalNotEmpty() {
# Line 108 | Line 108 | public class LinkedBlockingQueue<E> exte
108      }
109  
110      /**
111 <     * Signal a waiting put. Called only from take/poll.
111 >     * Signals a waiting put. Called only from take/poll.
112       */
113      private void signalNotFull() {
114          final ReentrantLock putLock = this.putLock;
# Line 121 | Line 121 | public class LinkedBlockingQueue<E> exte
121      }
122  
123      /**
124 <     * Create a node and link it at end of queue
124 >     * Creates a node and links it at end of queue.
125       * @param x the item
126       */
127      private void insert(E x) {
# Line 129 | Line 129 | public class LinkedBlockingQueue<E> exte
129      }
130  
131      /**
132 <     * Remove a node from head of queue,
132 >     * Removes a node from head of queue,
133       * @return the node
134       */
135      private E extract() {
# Line 185 | Line 185 | public class LinkedBlockingQueue<E> exte
185       * added in traversal order of the collection's iterator.
186       * @param c the collection of elements to initially contain
187       * @throws NullPointerException if <tt>c</tt> or any element within it
188 <     * is <tt>null</tt>
188 >     * is <tt>null</tt>.
189       */
190      public LinkedBlockingQueue(Collection<? extends E> c) {
191          this(Integer.MAX_VALUE);
# Line 320 | Line 320 | public class LinkedBlockingQueue<E> exte
320       * @param o the element to add.
321       * @return <tt>true</tt> if it was possible to add the element to
322       *         this queue, else <tt>false</tt>
323 <     * @throws NullPointerException if the specified element is <tt>null</tt>
323 >     * @throws NullPointerException if the specified element is <tt>null</tt>.
324       */
325      public boolean offer(E o) {
326          if (o == null) throw new NullPointerException();
# Line 562 | Line 562 | public class LinkedBlockingQueue<E> exte
562          }
563          return n;
564      }
565 <        
565 >
566      public int drainTo(Collection<? super E> c, int maxElements) {
567          if (c == null)
568              throw new NullPointerException();
# Line 595 | Line 595 | public class LinkedBlockingQueue<E> exte
595      /**
596       * Returns an iterator over the elements in this queue in proper sequence.
597       * The returned <tt>Iterator</tt> is a "weakly consistent" iterator that
598 <     * will never throw {@link java.util.ConcurrentModificationException},
598 >     * will never throw {@link ConcurrentModificationException},
599       * and guarantees to traverse elements as they existed upon
600       * construction of the iterator, and may (but is not guaranteed to)
601       * reflect any modifications subsequent to construction.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines