Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 74 for Interrupter (0.1 sec)

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

        Thread interrupter =
            new Thread("Interrupter") {
              @Override
              public void run() {
                task.interruptTask();
              }
            };
        interrupter.start();
        // this will happen once the interrupt has been set which means that
        // 1. the runner has been woken up
        // 2. the interrupter is stuck in the call the Thread.interrupt()
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/QueuesTest.java

        Future<?> possiblyIgnoredError = threadPool.submit(new Interrupter(currentThread()));
    
        Stopwatch timer = Stopwatch.createStarted();
        Queues.drainUninterruptibly(q, newArrayList(), 1, 10, MILLISECONDS);
        assertThat(timer.elapsed(MILLISECONDS)).isAtLeast(10L);
        // wait for interrupted status and clear it
        while (!Thread.interrupted()) {
          Thread.yield();
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java

        /*
         * If someone called cancel(true), it is possible that the interrupted bit hasn't been set yet.
         * Wait for the interrupting thread to set DONE. (See interruptTask().) We want to wait so that
         * the interrupting thread doesn't interrupt the _next_ thing to run on this thread.
         *
         * Note: We don't reset the interrupted bit, just wait for it to be set. If this is a thread
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  4. guava/src/com/google/common/util/concurrent/InterruptibleTask.java

        /*
         * If someone called cancel(true), it is possible that the interrupted bit hasn't been set yet.
         * Wait for the interrupting thread to set DONE. (See interruptTask().) We want to wait so that
         * the interrupting thread doesn't interrupt the _next_ thing to run on this thread.
         *
         * Note: We don't reset the interrupted bit, just wait for it to be set. If this is a thread
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  5. guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

      class Interruptenator extends Thread {
        final AtomicBoolean shutdown;
    
        Interruptenator(final Thread interruptee) {
          this(interruptee, new AtomicBoolean(false));
        }
    
        @SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
        Interruptenator(final Thread interruptee, final AtomicBoolean shutdown) {
          super(
              new Runnable() {
                @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

      private static final class Interruptenator implements Runnable {
        private final long everyMillis;
        private final Thread interruptee;
        private volatile boolean shouldStop = false;
    
        Interruptenator(Thread interruptee, long everyMillis) {
          this.everyMillis = everyMillis;
          this.interruptee = interruptee;
        }
    
        @Override
        public void run() {
          while (true) {
            try {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

      private static final class Interruptenator implements Runnable {
        private final long everyMillis;
        private final Thread interruptee;
        private volatile boolean shouldStop = false;
    
        Interruptenator(Thread interruptee, long everyMillis) {
          this.everyMillis = everyMillis;
          this.interruptee = interruptee;
        }
    
        @Override
        public void run() {
          while (true) {
            try {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.4K bytes
    - Viewed (0)
  8. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

      class Interruptenator extends Thread {
        final AtomicBoolean shutdown;
    
        Interruptenator(final Thread interruptee) {
          this(interruptee, new AtomicBoolean(false));
        }
    
        @SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
        Interruptenator(final Thread interruptee, final AtomicBoolean shutdown) {
          super(
              new Runnable() {
                @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  9. guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      public static void awaitUninterruptibly(CountDownLatch latch) {
        boolean interrupted = false;
        try {
          while (true) {
            try {
              latch.await();
              return;
            } catch (InterruptedException e) {
              interrupted = true;
            }
          }
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:51:36 UTC 2024
    - 19.1K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

          }
    
          /** Checks if the state is {@link #CANCELLED} or {@link #INTERRUPTED}. */
          boolean isCancelled() {
            return (getState() & (CANCELLED | INTERRUPTED)) != 0;
          }
    
          /** Checks if the state is {@link #INTERRUPTED}. */
          boolean wasInterrupted() {
            return getState() == INTERRUPTED;
          }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 02:42:09 UTC 2024
    - 13.6K bytes
    - Viewed (0)
Back to top