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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentLinkedQueue.java (file contents):
Revision 1.56 by jsr166, Tue Aug 24 22:30:24 2010 UTC vs.
Revision 1.57 by jsr166, Wed Sep 1 22:49:09 2010 UTC

# Line 142 | Line 142 | public class ConcurrentLinkedQueue<E> ex
142          private volatile E item;
143          private volatile Node<E> next;
144  
145 +        /**
146 +         * Constructs a new node.  Uses relaxed write because item can
147 +         * only be seen after publication via casNext.
148 +         */
149          Node(E item) {
150 <            // Piggyback on imminent casNext()
147 <            lazySetItem(item);
150 >            UNSAFE.putObject(this, itemOffset, item);
151          }
152  
153          E getItem() {
# Line 159 | Line 162 | public class ConcurrentLinkedQueue<E> ex
162              item = val;
163          }
164  
162        void lazySetItem(E val) {
163            UNSAFE.putOrderedObject(this, itemOffset, val);
164        }
165
165          void lazySetNext(Node<E> val) {
166              UNSAFE.putOrderedObject(this, nextOffset, val);
167          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines