Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 74 for countdown (0.06 sec)

  1. guava-testlib/src/com/google/common/testing/GcFinalization.java

     *
     * <p>Here's an example that tests a {@code finalize} method:
     *
     * <pre>{@code
     * final CountDownLatch latch = new CountDownLatch(1);
     * Object x = new MyClass() {
     *   ...
     *   protected void finalize() { latch.countDown(); ... }
     * };
     * x = null;  // Hint to the JIT that x is stack-unreachable
     * GcFinalization.await(latch);
     * }</pre>
     *
     * <p>Here's an example that uses a user-defined finalization predicate:
     *
     * <pre>{@code
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

                synchronized(failures) {
                  failures.add(e)
                }
                latch.countDown()
              }
    
              override fun onResponse(
                call: Call,
                response: Response,
              ) {
                processResponse(response, hostname, responses, failures)
                latch.countDown()
              }
            },
          )
        }
    
        try {
          latch.await()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Oct 31 09:27:31 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  3. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

              addresses: List<InetAddress>,
            ) {
              allAddresses.addAll(addresses)
              latch.countDown()
            }
    
            override fun onFailure(
              hostname: String,
              e: IOException,
            ) {
              exception = e
              latch.countDown()
            }
          },
        )
    
        latch.await()
    
        return Pair(allAddresses, exception)
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

              outputFuture.set(RESULT_DATA);
              break;
            case SLOW_OUTPUT_VALID_INPUT_DATA:
              break; // do nothing to the result
            case SLOW_FUNC_VALID_INPUT_DATA:
              funcIsWaitingLatch.countDown();
              awaitUninterruptibly(funcCompletionLatch);
              break;
            case EXCEPTION_DATA:
              throw EXCEPTION;
          }
          return outputFuture;
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

              outputFuture.set(RESULT_DATA);
              break;
            case SLOW_OUTPUT_VALID_INPUT_DATA:
              break; // do nothing to the result
            case SLOW_FUNC_VALID_INPUT_DATA:
              funcIsWaitingLatch.countDown();
              awaitUninterruptibly(funcCompletionLatch);
              break;
            case EXCEPTION_DATA:
              throw EXCEPTION;
          }
          return outputFuture;
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  6. android/guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java

        this.countDownLatch = new CountDownLatch(1);
        this.future = future;
    
        future.addListener(this, directExecutor());
      }
    
      @Override
      public void run() {
        countDownLatch.countDown();
      }
    
      /**
       * Verify that the listener completes in a reasonable amount of time, and Asserts that the future
       * returns the expected data.
       *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri May 12 18:12:42 UTC 2023
    - 3K bytes
    - Viewed (0)
  7. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

        endsFirst.join()
        // First response is still waiting.
        assertThat(firstResponseCode.get()).isEqualTo(0)
        // Second response is done.
        assertThat(secondResponseCode.get()).isEqualTo(200)
        latch.countDown()
        startsFirst.join()
        // And now it's done!
        assertThat(firstResponseCode.get()).isEqualTo(200)
        // (Still done).
        assertThat(secondResponseCode.get()).isEqualTo(200)
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java

        this.latch = new CountDownLatch(1);
      }
    
      public void setUp() {
        future.addListener(
            new Runnable() {
              @Override
              public void run() {
                latch.countDown();
              }
            },
            exec);
    
        assertEquals(1, latch.getCount());
        assertFalse(future.isDone());
        assertFalse(future.isCancelled());
      }
    
      public void tearDown() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  9. src/bufio/scan_test.go

    	}
    }
    
    type countdown int
    
    func (c *countdown) split(data []byte, atEOF bool) (advance int, token []byte, err error) {
    	if *c > 0 {
    		*c--
    		return 1, data[:1], nil
    	}
    	return 0, nil, nil
    }
    
    // Check that the looping-at-EOF check doesn't trigger for merely empty tokens.
    func TestEmptyLinesOK(t *testing.T) {
    	c := countdown(10000)
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Sep 22 16:22:42 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  10. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        Object unused =
            new Object() {
              @SuppressWarnings({"removal", "Finalize"}) // b/260137033
              @Override
              protected void finalize() {
                latch.countDown();
              }
            };
        unused = null; // Hint to the JIT that unused is unreachable
        GcFinalization.await(latch);
        assertEquals(0, latch.getCount());
      }
    
      public void testAwaitDone_future() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 7.9K bytes
    - Viewed (0)
Back to top