()
| 418 | |
| 419 | |
| 420 | private void drainQueue() { |
| 421 | Reference<? extends L> ref; |
| 422 | while ((ref = queue.poll()) != null) { |
| 423 | // We only ever register ArrayReferences with the queue so this is always safe. |
| 424 | ArrayReference<? extends L> arrayRef = (ArrayReference<? extends L>) ref; |
| 425 | // Try to clear out the array slot, n.b. if we fail that is fine, in either case the |
| 426 | // arrayRef will be out of the array after this step. |
| 427 | locks.compareAndSet(arrayRef.index, arrayRef, null); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | @Override |
| 432 | public int size() { |
no test coverage detected