MCPcopy Create free account
hub / github.com/antlr/codebuff / drainQueue

Method drainQueue

output/java_guava/1.4.19/Striped.java:420–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers 1

getAtMethod · 0.95

Calls 2

pollMethod · 0.45
compareAndSetMethod · 0.45

Tested by

no test coverage detected