Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 115 for interrupt (0.2 sec)

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

            () -> getUninterruptibly(delayedFuture, 500, TimeUnit.MILLISECONDS));
        assertTrue(Thread.interrupted()); // clears the interrupt state, too
    
        assertFalse(sleeper.completed);
        assertTrue(getUninterruptibly(delayedFuture));
    
        assertTrue(Thread.interrupted()); // clears the interrupt state, too
        assertTrue(sleeper.completed);
      }
    
      private static class SleepingRunnable implements Runnable {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.1K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

      }
    
      /**
       * Await an interrupt, then clear the interrupt status. Similar to {@code
       * assertTrue(Thread.interrupted())} except that this version tolerates late interrupts.
       */
      private static void assertInterrupted() {
        try {
          /*
           * The sleep() will end immediately if we've already been interrupted or
           * wait patiently for the interrupt if not.
           */
    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)
  3. android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

              suite,
              method,
              Scenario.UNSATISFIED_AND_INTERRUPTED_BEFORE_WAITING,
              TimeoutsToUse.PAST,
              // prefer responding to interrupt over timing out
              isInterruptible(method) ? Outcome.INTERRUPT : Outcome.FAILURE);
          addTests(
              suite,
              method,
              Scenario.UNSATISFIED_AND_INTERRUPTED_BEFORE_WAITING,
              TimeoutsToUse.SMALL,
    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)
  4. guava-tests/test/com/google/common/util/concurrent/SequentialExecutorTest.java

        // Run a task on the composed Executor that interrupts its thread (i.e. this thread).
        fakePool.execute(
            new Runnable() {
              @Override
              public void run() {
                Thread.currentThread().interrupt();
              }
            });
        // Run a task that expects that it is not interrupted while it is running.
        e.execute(
            new Runnable() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 11.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/FuturesGetUncheckedTest.java

      }
    
      @J2ktIncompatible
      @GwtIncompatible // Thread.interrupt
      public void testGetUnchecked_interrupted() {
        Thread.currentThread().interrupt();
        try {
          assertEquals("foo", getUnchecked(immediateFuture("foo")));
          assertTrue(Thread.currentThread().isInterrupted());
        } finally {
          Thread.interrupted();
        }
      }
    
      public void testGetUnchecked_cancelled() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

      }
    
      /**
       * Await an interrupt, then clear the interrupt status. Similar to {@code
       * assertTrue(Thread.interrupted())} except that this version tolerates late interrupts.
       */
      private static void assertInterrupted() {
        try {
          /*
           * The sleep() will end immediately if we've already been interrupted or
           * wait patiently for the interrupt if not.
           */
    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)
  7. android/guava/src/com/google/common/base/Ascii.java

       * Device Control 1. Characters for the control of ancillary devices associated with data
       * processing or telecommunication systems, more especially switching devices "on" or "off." (If a
       * single "stop" control is required to interrupt or turn off ancillary devices, DC4 is the
       * preferred assignment.)
       *
       * @since 8.0
       */
      public static final byte DC1 = 17; // aka XON
    
      /**
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Jul 19 15:43:07 GMT 2021
    - 21.6K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     * ordinary tests.
     *
     * <p>Failure of the expected event to occur within an implementation-defined "reasonable" time
     * 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);
    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)
  9. android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

            new Runnable() {
              @Override
              public void run() {
                try {
                  okayToRun.await();
                } catch (InterruptedException e) {
                  Thread.currentThread().interrupt();
                  throw new RuntimeException(e);
                }
                runCalled.getAndIncrement();
              }
            },
            directExecutor());
        Runnable execute =
            new Runnable() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 4.7K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Platform.java

      }
    
      static void restoreInterruptIfIsInterruptedException(Throwable t) {
        checkNotNull(t); // to satisfy NullPointerTester
        if (t instanceof InterruptedException) {
          currentThread().interrupt();
        }
      }
    
      private Platform() {}
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue May 10 12:27:25 GMT 2022
    - 1.4K bytes
    - Viewed (0)
Back to top