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); |
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) ? |
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 |
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 { |