Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for CountDownLatch (0.21 sec)

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

     * period or an interrupt while waiting for the expected event will result in a {@link
     * RuntimeException}.
     *
     * <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);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

      private final Timeout timeout;
      private final Outcome expectedOutcome;
      private final Monitor monitor;
      private final FlagGuard guard;
      private final CountDownLatch tearDownLatch;
      private final CountDownLatch doingCallLatch;
      private final CountDownLatch callCompletedLatch;
    
      private GeneratedMonitorTest(
          Method method,
          Scenario scenario,
          boolean fair,
          @Nullable Timeout timeout,
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 17 14:48:57 GMT 2023
    - 26.1K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

      }
    
      public void testNull() throws Exception {
        new NullPointerTester()
            .setDefault(CountDownLatch.class, new CountDownLatch(0))
            .setDefault(Semaphore.class, new Semaphore(999))
            .testAllPublicStaticMethods(Uninterruptibles.class);
      }
    
      // IncrementableCountDownLatch.await() tests
    
      // CountDownLatch.await() tests
    
      // Condition.await() tests
      public void testConditionAwaitTimeoutExceeded() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 31.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheBuilderTest.java

                .build(computingFunction);
    
        // seed the map, so its segment's count > 0
        cache.getUnchecked("a");
        shouldWait.set(true);
    
        final CountDownLatch computationStarted = new CountDownLatch(1);
        final CountDownLatch computationComplete = new CountDownLatch(1);
        new Thread(
                new Runnable() {
                  @Override
                  public void run() {
                    computationStarted.countDown();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 25.5K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     * period or an interrupt while waiting for the expected event will result in a {@link
     * RuntimeException}.
     *
     * <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);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java

                .build(computingFunction);
    
        // seed the map, so its segment's count > 0
        cache.getUnchecked("a");
        shouldWait.set(true);
    
        final CountDownLatch computationStarted = new CountDownLatch(1);
        final CountDownLatch computationComplete = new CountDownLatch(1);
        new Thread(
                new Runnable() {
                  @Override
                  public void run() {
                    computationStarted.countDown();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java

     */
    public class AbstractExecutionThreadServiceTest extends TestCase {
    
      private final TearDownStack tearDownStack = new TearDownStack(true);
      private final CountDownLatch enterRun = new CountDownLatch(1);
      private final CountDownLatch exitRun = new CountDownLatch(1);
    
      private Thread executionThread;
      private Throwable thrownByExecutionThread;
      private final Executor exceptionCatchingExecutor =
          new Executor() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

      private final Timeout timeout;
      private final Outcome expectedOutcome;
      private final Monitor monitor;
      private final FlagGuard guard;
      private final CountDownLatch tearDownLatch;
      private final CountDownLatch doingCallLatch;
      private final CountDownLatch callCompletedLatch;
    
      private GeneratedMonitorTest(
          Method method,
          Scenario scenario,
          boolean fair,
          @Nullable Timeout timeout,
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 14:48:57 GMT 2023
    - 27.4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java

       * even permanently blocked.
       */
      public void testListenerDeadlock() throws InterruptedException {
        final CountDownLatch failEnter = new CountDownLatch(1);
        final CountDownLatch failLeave = new CountDownLatch(1);
        final CountDownLatch afterStarted = new CountDownLatch(1);
        Service failRunService =
            new AbstractService() {
              @Override
              protected void doStart() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 02 17:20:27 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      // methods is identical, save for method being invoked.
    
      /** Invokes {@code latch.}{@link CountDownLatch#await() await()} uninterruptibly. */
      @J2ktIncompatible
      @GwtIncompatible // concurrency
      public static void awaitUninterruptibly(CountDownLatch latch) {
        boolean interrupted = false;
        try {
          while (true) {
            try {
              latch.await();
              return;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
Back to top