243 |
// This method will get inlined. |
// This method will get inlined. |
244 |
cleanQueue(); |
cleanQueue(); |
245 |
if (knownMod != modCount) |
if (knownMod != modCount) |
246 |
throw new ConcurrentModificationException(); |
throw new ConcurrentModificationException(knownMod + " != " |
247 |
|
+ modCount); |
248 |
} |
} |
249 |
|
|
250 |
/** |
/** |
701 |
// bucket may be enqueued later by the garbage collection, and |
// bucket may be enqueued later by the garbage collection, and |
702 |
// internalRemove will be called a second time. |
// internalRemove will be called a second time. |
703 |
bucket.slot = -1; |
bucket.slot = -1; |
704 |
if (buckets[slot] == bucket) |
|
705 |
buckets[slot] = bucket.next; |
WeakBucket prev = null; |
706 |
else |
WeakBucket next = buckets[slot]; |
707 |
{ |
while (next != bucket) |
708 |
WeakBucket prev = buckets[slot]; |
{ |
709 |
/* This may throw a NullPointerException. It shouldn't but if |
if (next == null) throw new InternalError("WeakHashMap in incosistent state"); |
710 |
* a race condition occurred (two threads removing the same |
prev = next; |
711 |
* bucket at the same time) it may happen. <br> |
next = prev.next; |
|
* But with race condition many much worse things may happen |
|
|
* anyway. |
|
|
*/ |
|
|
while (prev.next != bucket) |
|
|
prev = prev.next; |
|
|
prev.next = bucket.next; |
|
712 |
} |
} |
713 |
|
if (prev == null) |
714 |
|
buckets[slot] = bucket.next; |
715 |
|
else |
716 |
|
prev.next = bucket.next; |
717 |
|
|
718 |
size--; |
size--; |
719 |
} |
} |
720 |
|
|