int retries = (int)(Math.round(1000L * TIMEOUT_FACTOR) / 200); for (; retries >= 0; retries--) { if (booleanSupplier.getAsBoolean()) { returntrue;
}
System.gc();
try { // The remove() will always block for the specified milliseconds // if the reference has already been removed from the queue. // But it is fine. For most cases, the 1st GC is sufficient // to trigger and complete the cleanup.
queue.remove(200L);
} catch (InterruptedException ie) { // ignore, the loop will try again
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.