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

Comparing jsr166/src/main/java/util/concurrent/SynchronousQueue.java (file contents):
Revision 1.69 by dl, Sat Sep 4 14:57:32 2010 UTC vs.
Revision 1.70 by jsr166, Tue Sep 7 23:17:10 2010 UTC

# Line 260 | Line 260 | public class SynchronousQueue<E> extends
260  
261          /** The head (top) of the stack */
262          volatile SNode head;
263 <        
263 >
264          boolean casHead(SNode h, SNode nh) {
265 <            return h == head &&
265 >            return h == head &&
266                  UNSAFE.compareAndSwapObject(this, headOffset, h, nh);
267          }
268  
# Line 514 | Line 514 | public class SynchronousQueue<E> extends
514              void tryCancel(Object cmp) {
515                  UNSAFE.compareAndSwapObject(this, itemOffset, cmp, this);
516              }
517 <            
517 >
518              boolean isCancelled() {
519                  return item == this;
520              }
# Line 558 | Line 558 | public class SynchronousQueue<E> extends
558           * old head's next node to avoid garbage retention.
559           */
560          void advanceHead(QNode h, QNode nh) {
561 <            if (h == head &&
561 >            if (h == head &&
562                  UNSAFE.compareAndSwapObject(this, headOffset, h, nh))
563                  h.next = h; // forget old next
564          }
# Line 770 | Line 770 | public class SynchronousQueue<E> extends
770              objectFieldOffset(UNSAFE, "tail", TransferQueue.class);
771          private static final long cleanMeOffset =
772              objectFieldOffset(UNSAFE, "cleanMe", TransferQueue.class);
773 <        
773 >
774      }
775  
776      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines