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

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.60 by dl, Mon Oct 11 10:24:02 2010 UTC vs.
Revision 1.61 by jsr166, Mon Oct 11 17:38:24 2010 UTC

# Line 191 | Line 191 | public class PriorityBlockingQueue<E> ex
191              initElementsFromCollection(ss);
192          }
193          else if (c instanceof PriorityBlockingQueue<?>) {
194 <            PriorityBlockingQueue<? extends E> pq =
194 >            PriorityBlockingQueue<? extends E> pq =
195                  (PriorityBlockingQueue<? extends E>) c;
196              this.comparator = (Comparator<? super E>) pq.comparator();
197              initFromPriorityBlockingQueue(pq);
# Line 243 | Line 243 | public class PriorityBlockingQueue<E> ex
243          lock.unlock(); // must release and then re-acquire main lock
244          Object[] newArray = null;
245          if (allocationSpinLock == 0 &&
246 <            UNSAFE.compareAndSwapInt(this, allocationSpinLockOffset,
246 >            UNSAFE.compareAndSwapInt(this, allocationSpinLockOffset,
247                                       0, 1)) {
248              try {
249                  int newCap = oldCap + ((oldCap < 64) ?
# Line 524 | Line 524 | public class PriorityBlockingQueue<E> ex
524          }
525          return result;
526      }
527 <    
527 >
528      /**
529       * Returns the comparator used to order the elements in this queue,
530       * or <tt>null</tt> if this queue uses the {@linkplain Comparable
# Line 904 | Line 904 | public class PriorityBlockingQueue<E> ex
904      // Unsafe mechanics
905      private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
906      private static final long allocationSpinLockOffset =
907 <        objectFieldOffset(UNSAFE, "allocationSpinLock",
907 >        objectFieldOffset(UNSAFE, "allocationSpinLock",
908                            PriorityBlockingQueue.class);
909 <    
909 >
910      static long objectFieldOffset(sun.misc.Unsafe UNSAFE,
911                                    String field, Class<?> klazz) {
912          try {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines