changeset 8909:3f2563711847

Sync of some classes from 166.
author psandoz
date Thu, 27 Jun 2013 14:29:24 +0200
parents 6e6c948105db
children 5acf515f2c63
files src/share/classes/java/util/concurrent/BlockingDeque.java src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java
diffstat 3 files changed, 23 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/concurrent/BlockingDeque.java	Thu Jun 27 11:04:13 2013 +0200
+++ b/src/share/classes/java/util/concurrent/BlockingDeque.java	Thu Jun 27 14:29:24 2013 +0200
@@ -637,9 +637,10 @@
     // *** Stack methods ***
 
     /**
-     * Pushes an element onto the stack represented by this deque.  In other
-     * words, inserts the element at the front of this deque unless it would
-     * violate capacity restrictions.
+     * Pushes an element onto the stack represented by this deque (in other
+     * words, at the head of this deque) if it is possible to do so
+     * immediately without violating capacity restrictions, throwing an
+     * {@code IllegalStateException} if no space is currently available.
      *
      * <p>This method is equivalent to {@link #addFirst(Object) addFirst}.
      *
--- a/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Thu Jun 27 11:04:13 2013 +0200
+++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java	Thu Jun 27 14:29:24 2013 +0200
@@ -1027,11 +1027,27 @@
     }
 
     public E poll()           { return pollFirst(); }
+    public E peek()           { return peekFirst(); }
+
+    /**
+     * @throws NoSuchElementException {@inheritDoc}
+     */
     public E remove()         { return removeFirst(); }
-    public E peek()           { return peekFirst(); }
+
+    /**
+     * @throws NoSuchElementException {@inheritDoc}
+     */
+    public E pop()            { return removeFirst(); }
+
+    /**
+     * @throws NoSuchElementException {@inheritDoc}
+     */
     public E element()        { return getFirst(); }
+
+    /**
+     * @throws NullPointerException {@inheritDoc}
+     */
     public void push(E e)     { addFirst(e); }
-    public E pop()            { return removeFirst(); }
 
     /**
      * Removes the first element {@code e} such that
--- a/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java	Thu Jun 27 11:04:13 2013 +0200
+++ b/src/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java	Thu Jun 27 14:29:24 2013 +0200
@@ -59,7 +59,7 @@
  * Like most other concurrent collection implementations, this class
  * does not permit the use of {@code null} elements.
  *
- * <p>This implementation employs an efficient &quot;wait-free&quot;
+ * <p>This implementation employs an efficient <em>non-blocking</em>
  * algorithm based on one described in <a
  * href="http://www.cs.rochester.edu/u/michael/PODC96.html"> Simple,
  * Fast, and Practical Non-Blocking and Blocking Concurrent Queue
@@ -881,7 +881,6 @@
         }
     }
 
-
     public Spliterator<E> spliterator() {
         return new CLQSpliterator<E>(this);
     }