Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 95 for Interrupter (0.17 sec)

  1. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        final AtomicBoolean terminated = new AtomicBoolean();
        // we need to keep this in a flag because t.isInterrupted() returns false after t.join()
        final AtomicBoolean interrupted = new AtomicBoolean();
        // we need to use another thread because it will be interrupted and thus using
        // the current one, owned by JUnit, would make the test fail
        Thread thread =
            new Thread(
                new Runnable() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  2. android/guava/src/com/google/common/util/concurrent/TimeLimiter.java

       * The particular nature and strength of the guarantees made by the proxy is
       * implementation-dependent. However, it is important that each of the methods on the target
       * object behaves appropriately when its thread is interrupted.
       *
       * <p>For example, to return the value of {@code target.someMethod()}, but substitute {@code
       * DEFAULT_VALUE} if this method call takes over 50 ms, you can use this code:
       *
       * <pre>
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 18:32:03 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        if (Thread.currentThread().isInterrupted()) {
          throw new AssertionError(
              "Thread interrupted on test entry. "
                  + "Some test probably didn't clear the interrupt state");
        }
    
        tearDownStack.addTearDown(
            new TearDown() {
              @Override
              public void tearDown() {
                Thread.interrupted();
              }
            });
      }
    
      @Override
      protected void tearDown() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 30.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/cache/CacheLoader.java

       * @return the value associated with {@code key}; <b>must not be null</b>
       * @throws Exception if unable to load the result
       * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
       *     treated like any other {@code Exception} in all respects except that, when it is caught,
       *     the thread's interrupt status is set
       */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 19 20:20:14 GMT 2022
    - 9.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java

        } catch (ExecutionException executionException) {
          assertThat(executionException).hasCauseThat().isEqualTo(e);
        }
      }
    
      @J2ktIncompatible
      @GwtIncompatible // blocking wait
      public void testCancel_interrupted() throws Exception {
        final AtomicBoolean interruptedExceptionThrown = new AtomicBoolean();
        final CountDownLatch enterLatch = new CountDownLatch(1);
        final CountDownLatch exitLatch = new CountDownLatch(1);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 7.3K bytes
    - Viewed (0)
  6. maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java

            private volatile MavenSession session;
    
            public void run() {
                try {
                    latch.await();
                } catch (InterruptedException ignore) {
                    // Test may fail if we get interrupted
                }
                session = defaultLegacySupport.getSession();
            }
    
            public MavenSession getSession() {
                return session;
            }
        }
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Wed Sep 06 08:39:32 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/TestPlatform.java

          throw failureWithCause(e, "");
        }
      }
    
      static void verifyThreadWasNotInterrupted() {
        assertFalse(Thread.currentThread().isInterrupted());
      }
    
      static void clearInterrupt() {
        Thread.interrupted();
      }
    
      /**
       * Retrieves the result of a {@code Future} known to be done but uses the {@code get(long,
       * TimeUnit)} overload in order to test that method.
       */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.9K bytes
    - Viewed (0)
  8. guava/src/com/google/common/cache/LoadingCache.java

       *     ExecutionException} is thrown <a
       *     href="https://github.com/google/guava/wiki/CachesExplained#interruption">even if
       *     computation was interrupted by an {@code InterruptedException}</a>.)
       * @throws UncheckedExecutionException if an unchecked exception was thrown while loading the
       *     value
       * @throws ExecutionError if an error was thrown while loading the value
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Sat Aug 06 17:12:03 GMT 2022
    - 8.3K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheLoadingTest.java

        assertEquals(0, stats.hitCount());
    
        // Sanity check:
        assertFalse(currentThread().interrupted());
    
        Exception expected = assertThrows(ExecutionException.class, () -> cache.get(new Object()));
        assertThat(expected).hasCauseThat().isSameInstanceAs(e);
        assertTrue(currentThread().interrupted());
        stats = cache.stats();
        assertEquals(1, stats.missCount());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 86.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

          else {
            AssertionFailedError afe = new AssertionFailedError(t.toString());
            afe.initCause(t);
            throw afe;
          }
        }
    
        if (Thread.interrupted()) throw new AssertionFailedError("interrupt status set in main thread");
      }
    
      /**
       * Just like fail(reason), but additionally recording (using threadRecordFailure) any
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.2K bytes
    - Viewed (0)
Back to top