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

Comparing jsr166/src/jsr166y/LinkedTransferQueue.java (file contents):
Revision 1.16 by jsr166, Mon Mar 30 04:32:23 2009 UTC vs.
Revision 1.17 by jsr166, Tue Mar 31 15:17:19 2009 UTC

# Line 166 | Line 166 | public class LinkedTransferQueue<E> exte
166       * Puts or takes an item. Used for most queue operations (except
167       * poll() and tryTransfer()). See the similar code in
168       * SynchronousQueue for detailed explanation.
169 +     *
170       * @param e the item or if null, signifies that this is a take
171       * @param mode the wait mode: NOWAIT, TIMEOUT, WAIT
172       * @param nanos timeout in nanosecs, used only if mode is TIMEOUT
# Line 212 | Line 213 | public class LinkedTransferQueue<E> exte
213  
214      /**
215       * Version of xfer for poll() and tryTransfer, which
216 <     * simplifies control paths both here and in xfer
216 >     * simplifies control paths both here and in xfer.
217       */
218      private Object fulfill(Object e) {
219          boolean isData = (e != null);
# Line 272 | Line 273 | public class LinkedTransferQueue<E> exte
273              Object x = s.get();
274              if (x != e) {                 // Node was matched or cancelled
275                  advanceHead(pred, s);     // unlink if head
276 <                if (x == s) {              // was cancelled
276 >                if (x == s) {             // was cancelled
277                      clean(pred, s);
278                      return null;
279                  }
# Line 316 | Line 317 | public class LinkedTransferQueue<E> exte
317      }
318  
319      /**
320 <     * Returns validated tail for use in cleaning methods
320 >     * Returns validated tail for use in cleaning methods.
321       */
322      private QNode getValidatedTail() {
323          for (;;) {
# Line 339 | Line 340 | public class LinkedTransferQueue<E> exte
340  
341      /**
342       * Gets rid of cancelled node s with original predecessor pred.
343 +     *
344       * @param pred predecessor of cancelled node
345       * @param s the cancelled node
346       */
# Line 378 | Line 380 | public class LinkedTransferQueue<E> exte
380      /**
381       * Tries to unsplice the cancelled node held in cleanMe that was
382       * previously uncleanable because it was at tail.
383 +     *
384       * @return current cleanMe node (or null)
385       */
386      private QNode reclean() {
# Line 422 | Line 425 | public class LinkedTransferQueue<E> exte
425       * Creates a {@code LinkedTransferQueue}
426       * initially containing the elements of the given collection,
427       * added in traversal order of the collection's iterator.
428 +     *
429       * @param c the collection of elements to initially contain
430       * @throws NullPointerException if the specified collection or any
431       *         of its elements are null
# Line 530 | Line 534 | public class LinkedTransferQueue<E> exte
534      // Traversal-based methods
535  
536      /**
537 <     * Return head after performing any outstanding helping steps
537 >     * Returns head after performing any outstanding helping steps.
538       */
539      private QNode traversalHead() {
540          for (;;) {
# Line 582 | Line 586 | public class LinkedTransferQueue<E> exte
586          }
587  
588          /**
589 <         * Ensure next points to next valid node, or null if none.
589 >         * Ensures next points to next valid node, or null if none.
590           */
591          void findNext() {
592              for (;;) {
# Line 732 | Line 736 | public class LinkedTransferQueue<E> exte
736                  if (q == pred) // restart
737                      break;
738                  Object x = q.get();
739 <                if (x != null && x != q && o.equals(x) &&
739 >                if (x != null && x != q && o.equals(x) &&
740                      q.compareAndSet(x, q)) {
741                      clean(pred, q);
742                      return true;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines