Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for Sleep (0.13 sec)

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

            public String call() throws InterruptedException {
              MILLISECONDS.sleep(DELAY_MS);
              return GOOD_CALLABLE_RESULT;
            }
          };
      private static final Callable<String> BAD_CALLABLE =
          new Callable<String>() {
            @Override
            public String call() throws InterruptedException, SampleException {
              MILLISECONDS.sleep(DELAY_MS);
              throw new SampleException();
            }
          };
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

            public String call() throws InterruptedException {
              MILLISECONDS.sleep(DELAY_MS);
              return GOOD_CALLABLE_RESULT;
            }
          };
      private static final Callable<String> BAD_CALLABLE =
          new Callable<String>() {
            @Override
            public String call() throws InterruptedException, SampleException {
              MILLISECONDS.sleep(DELAY_MS);
              throw new SampleException();
            }
          };
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/InterruptionUtil.java

          this.everyMillis = everyMillis;
          this.interruptee = interruptee;
        }
    
        @Override
        public void run() {
          while (true) {
            try {
              Thread.sleep(everyMillis);
            } catch (InterruptedException e) {
              // ok. just stop sleeping.
            }
            if (shouldStop) {
              break;
            }
            interruptee.interrupt();
          }
        }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (1)
  4. android/guava-tests/test/com/google/common/cache/CacheReferencesTest.java

        for (int i = 0; i < 500; i++) {
          System.gc();
    
          CacheTesting.drainReferenceQueues(cache);
          if (cache.size() == 1) {
            break;
          }
          try {
            Thread.sleep(10);
          } catch (InterruptedException e) {
            /* ignore */
          }
          try {
            // Fill up heap so soft references get cleared.
            filler = new byte[Math.max(filler.length, filler.length * 2)];
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 6.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java

        final int millis;
        volatile boolean completed;
    
        public SleepingRunnable(int millis) {
          this.millis = millis;
        }
    
        @Override
        public void run() {
          try {
            Thread.sleep(millis);
          } catch (InterruptedException wontHappen) {
            throw new AssertionError();
          }
          completed = true;
        }
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.1K bytes
    - Viewed (0)
  6. android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java

            new Callable<@Nullable Void>() {
              @Override
              public @Nullable Void call() throws Exception {
                // adds two nanoseconds to the ticker
                ticker.advance(1L);
                Thread.sleep(10);
                ticker.advance(1L);
                return null;
              }
            });
    
        assertEquals(numberOfThreads * 2, ticker.read());
      }
    
      @GwtIncompatible // concurrency
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  7. guava-testlib/test/com/google/common/testing/FakeTickerTest.java

            new Callable<@Nullable Void>() {
              @Override
              public @Nullable Void call() throws Exception {
                // adds two nanoseconds to the ticker
                ticker.advance(1L);
                Thread.sleep(10);
                ticker.advance(1L);
                return null;
              }
            });
    
        assertEquals(numberOfThreads * 2, ticker.read());
      }
    
      @GwtIncompatible // concurrency
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

        while (!isThreadBlockedOnInstanceOf(t, blocker)) {
          if (t.getState() == Thread.State.TERMINATED) {
            throw new RuntimeException("Thread " + t + " exited unexpectedly");
          }
          Thread.sleep(1);
        }
      }
    
      private static boolean isThreadBlockedOnInstanceOf(Thread t, Class<?> blocker) {
        return t.getState() == Thread.State.WAITING && blocker.isInstance(LockSupport.getBlocker(t));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java

        final int millis;
        volatile boolean completed;
    
        public SleepingRunnable(int millis) {
          this.millis = millis;
        }
    
        @Override
        public void run() {
          try {
            Thread.sleep(millis);
          } catch (InterruptedException wontHappen) {
            throw new AssertionError();
          }
          completed = true;
        }
      }
    
    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)
  10. android/guava-testlib/test/com/google/common/util/concurrent/testing/TestingExecutorsTest.java

              public void run() {
                taskDone = true;
              }
            };
        ScheduledFuture<?> future =
            TestingExecutors.noOpScheduledExecutor().schedule(task, 10, TimeUnit.MILLISECONDS);
        Thread.sleep(20);
        assertFalse(taskDone);
        assertFalse(future.isDone());
      }
    
      public void testNoOpScheduledExecutorShutdown() {
        ListeningScheduledExecutorService executor = TestingExecutors.noOpScheduledExecutor();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
Back to top