Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 117 for Execute (0.2 sec)

  1. guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java

          if (executeImmediate) {
            new RunnableExecutorPair(runnable, executor).execute();
          }
        }
    
        public void execute() {
          synchronized (runnables) {
            if (executed) {
              return;
            }
            executed = true;
          }
    
          while (!runnables.isEmpty()) {
            runnables.poll().execute();
          }
        }
    
        private static class RunnableExecutorPair {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 15:19:38 GMT 2023
    - 20.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

                runCalled.getAndIncrement();
              }
            },
            directExecutor());
        Runnable execute =
            new Runnable() {
              @Override
              public void run() {
                list.execute();
              }
            };
        Thread thread1 = new Thread(execute);
        Thread thread2 = new Thread(execute);
        thread1.start();
        thread2.start();
        assertEquals(0, runCalled.get());
        okayToRun.countDown();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 4.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/DirectExecutor.java

    import java.util.concurrent.Executor;
    
    /**
     * An {@link Executor} that runs each task in the thread that invokes {@link Executor#execute
     * execute}.
     */
    @GwtCompatible
    @ElementTypesAreNonnullByDefault
    enum DirectExecutor implements Executor {
      INSTANCE;
    
      @Override
      public void execute(Runnable command) {
        command.run();
      }
    
      @Override
      public String toString() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 05 22:27:35 GMT 2021
    - 1.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/AbstractIdleService.java

       * this method to use a custom {@link Executor}, which may configure its worker thread with a
       * specific name, thread group or priority. The returned executor's {@link
       * Executor#execute(Runnable) execute()} method is called when this service is started and
       * stopped, and should return promptly.
       */
      protected Executor executor() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 17 13:59:28 GMT 2023
    - 5.3K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/WrappingExecutorServiceTest.java

          assertThat(task).isInstanceOf(WrappedRunnable.class);
          return inline.submit(task, result);
        }
    
        @Override
        public void execute(Runnable command) {
          lastMethodCalled = "execute";
          assertThat(command).isInstanceOf(WrappedRunnable.class);
          inline.execute(command);
        }
    
        private static <T> void assertTaskWrapped(Collection<? extends Callable<T>> tasks) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jan 05 19:41:03 GMT 2023
    - 9.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/AbstractExecutionThreadService.java

       * this method to use a custom {@link Executor}, which may configure its worker thread with a
       * specific name, thread group or priority. The returned executor's {@link
       * Executor#execute(Runnable) execute()} method is called when this service is started, and should
       * return promptly.
       *
       * <p>The default implementation returns a new {@link Executor} that sets the name of its threads
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 13 19:45:20 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/JdkFutureAdapters.java

              // If the delegate is already done, run the execution list immediately on the current
              // thread.
              executionList.execute();
              return;
            }
    
            // TODO(lukes): handle RejectedExecutionException
            adapterExecutor.execute(
                () -> {
                  try {
                    /*
                     * Threads from our private pool are never interrupted. Threads from a
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 14 20:35:03 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        ListeningExecutorService service = listeningDecorator(delegate);
        Runnable task =
            new Runnable() {
              @Override
              public void run() {}
            };
        service.execute(task);
        verify(delegate).execute(task);
      }
    
      public void testListeningDecorator_scheduleSuccess() throws Exception {
        final CountDownLatch completed = new CountDownLatch(1);
        ScheduledThreadPoolExecutor delegate =
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/ListenerCallQueue.java

       * case of an error.
       *
       * @param event the callback to execute on {@link #dispatch}
       */
      public void enqueue(Event<L> event) {
        enqueueHelper(event, event);
      }
    
      /**
       * Enqueues an event to be run on currently known listeners, with a label.
       *
       * @param event the callback to execute on {@link #dispatch}
       * @param label a description of the event to use in the case of an error
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 13 19:45:20 GMT 2023
    - 8.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/AbstractFutureInnocuousThreadTest.java

        // permissions.
        // submit()/join() causes this thread to execute the task instead, so we use a CountDownLatch as
        // a barrier to synchronize.
        // TODO(cpovirk): If some other test already initialized commonPool(), this won't work :(
        // Maybe we should just run this test in its own VM.
        ForkJoinPool.commonPool()
            .execute(
                () -> {
                  try {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Dec 16 19:54:45 GMT 2020
    - 5.1K bytes
    - Viewed (0)
Back to top