Home | History | Annotate | Download | only in testing

Lines Matching defs:latch

55  *   final CountDownLatch latch = new CountDownLatch(1);
58 * protected void finalize() { latch.countDown(); ... }
61 * GcFinalization.await(latch);
145 * Waits until the given latch has {@linkplain CountDownLatch#countDown counted down} to zero,
150 public static void await(CountDownLatch latch) {
151 if (latch.getCount() == 0) {
158 if (latch.getCount() == 0) {
163 if (latch.await(1L, SECONDS)) {
167 throw new RuntimeException("Unexpected interrupt while waiting for latch", ie);
171 String.format("Latch failed to count down within %d second timeout", timeoutSeconds));
175 * Creates a garbage object that counts down the latch in its finalizer. Sequestered into a
178 private static void createUnreachableLatchFinalizer(final CountDownLatch latch) {
179 new Object() { @Override protected void finalize() { latch.countDown(); }};