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

Comparing jsr166/src/jsr166x/LinkedBlockingDeque.java (file contents):
Revision 1.7 by jsr166, Thu Apr 14 23:16:10 2011 UTC vs.
Revision 1.12 by jsr166, Sat Dec 15 21:24:18 2012 UTC

# Line 14 | Line 14 | import java.util.concurrent.locks.*;
14   * An optionally-bounded {@linkplain BlockingDeque blocking deque} based on
15   * linked nodes.
16   *
17 < * <p> The optional capacity bound constructor argument serves as a
17 > * <p>The optional capacity bound constructor argument serves as a
18   * way to prevent excessive expansion. The capacity, if unspecified,
19   * is equal to {@link Integer#MAX_VALUE}.  Linked nodes are
20   * dynamically created upon each insertion unless this would bring the
# Line 39 | Line 39 | import java.util.concurrent.locks.*;
39   */
40   public class LinkedBlockingDeque<E>
41      extends AbstractQueue<E>
42 <    implements BlockingDeque<E>,  java.io.Serializable {
42 >    implements BlockingDeque<E>, java.io.Serializable {
43  
44      /*
45       * Implemented as a simple doubly-linked list protected by a
# Line 149 | Line 149 | public class LinkedBlockingDeque<E>
149      }
150  
151      /**
152 <     * Remove and return first element, or null if empty
152 >     * Removes and returns first element, or null if empty.
153       */
154      private E unlinkFirst() {
155          Node<E> f = first;
# Line 167 | Line 167 | public class LinkedBlockingDeque<E>
167      }
168  
169      /**
170 <     * Remove and return last element, or null if empty
170 >     * Removes and returns last element, or null if empty.
171       */
172      private E unlinkLast() {
173          Node<E> l = last;
# Line 434 | Line 434 | public class LinkedBlockingDeque<E>
434  
435      // BlockingQueue methods
436  
437 <    public void put(E o) throws InterruptedException  { putLast(o);  }
438 <    public E take() throws InterruptedException       { return takeFirst(); }
437 >    public void put(E o) throws InterruptedException { putLast(o); }
438 >    public E take() throws InterruptedException      { return takeFirst(); }
439      public boolean offer(E o, long timeout, TimeUnit unit)
440          throws InterruptedException    { return offerLast(o, timeout, unit); }
441      public E poll(long timeout, TimeUnit unit)
# Line 664 | Line 664 | public class LinkedBlockingDeque<E>
664           * an element exists in hasNext(), we must return item read
665           * under lock (in advance()) even if it was in the process of
666           * being removed when hasNext() was called.
667 <         **/
667 >         */
668          private E nextItem;
669  
670          /**
# Line 717 | Line 717 | public class LinkedBlockingDeque<E>
717      }
718  
719      /**
720 <     * Save the state to a stream (that is, serialize it).
720 >     * Saves the state to a stream (that is, serializes it).
721       *
722       * @serialData The capacity (int), followed by elements (each an
723       * <tt>Object</tt>) in the proper order, followed by a null
# Line 740 | Line 740 | public class LinkedBlockingDeque<E>
740      }
741  
742      /**
743 <     * Reconstitute this deque instance from a stream (that is,
744 <     * deserialize it).
743 >     * Reconstitutes this deque instance from a stream (that is,
744 >     * deserializes it).
745       * @param s the stream
746       */
747      private void readObject(java.io.ObjectInputStream s)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines