Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 114 for currentThread (0.19 sec)

  1. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

            try {
              latch.await();
              return;
            } catch (InterruptedException e) {
              interrupted = true;
            }
          }
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
      }
    
      /**
       * Invokes {@code latch.}{@link CountDownLatch#await(long, TimeUnit) await(timeout, unit)}
       * uninterruptibly.
       */
      @J2ktIncompatible
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/CallablesTest.java

      public void testRenaming() throws Exception {
        String oldName = Thread.currentThread().getName();
        final Supplier<String> newName = Suppliers.ofInstance("MyCrazyThreadName");
        Callable<@Nullable Void> callable =
            new Callable<@Nullable Void>() {
              @Override
              public @Nullable Void call() throws Exception {
                assertEquals(Thread.currentThread().getName(), newName.get());
                return null;
              }
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/Callables.java

        checkNotNull(callable);
        return () -> {
          Thread currentThread = Thread.currentThread();
          String oldName = currentThread.getName();
          boolean restoreName = trySetName(nameSupplier.get(), currentThread);
          try {
            return callable.call();
          } finally {
            if (restoreName) {
              boolean unused = trySetName(oldName, currentThread);
            }
          }
        };
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 18:32:03 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/CallablesTest.java

      public void testRenaming() throws Exception {
        String oldName = Thread.currentThread().getName();
        final Supplier<String> newName = Suppliers.ofInstance("MyCrazyThreadName");
        Callable<@Nullable Void> callable =
            new Callable<@Nullable Void>() {
              @Override
              public @Nullable Void call() throws Exception {
                assertEquals(Thread.currentThread().getName(), newName.get());
                return null;
              }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java

         * interrupt, yet it will still run, since interruptTask will leave the runner value null,
         * allowing the CAS below to succeed.
         */
        Thread currentThread = Thread.currentThread();
        if (!compareAndSet(null, currentThread)) {
          return; // someone else has run or is running.
        }
    
        boolean run = !isDone();
        T result = null;
        Throwable error = null;
        try {
          if (run) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Sep 29 21:34:48 GMT 2023
    - 9.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/ResourcesTest.java

        ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader();
        try {
          Thread.currentThread().setContextClassLoader(loader);
          URL url = Resources.getResource(tempFile.getName());
          String text = Resources.toString(url, Charsets.UTF_8);
          assertEquals("rud a chur ar an méar fhada" + System.lineSeparator(), text);
        } finally {
          Thread.currentThread().setContextClassLoader(oldContextLoader);
        }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  7. samples/crawler/src/main/java/okhttp3/sample/Crawler.java

            continue;
          }
    
          Thread currentThread = Thread.currentThread();
          String originalName = currentThread.getName();
          currentThread.setName("Crawler " + url);
          try {
            fetch(url);
          } catch (IOException e) {
            System.out.printf("XXX: %s %s%n", url, e);
          } finally {
            currentThread.setName(originalName);
          }
        }
      }
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 4.6K bytes
    - Viewed (0)
  8. maven-compat/src/main/java/org/apache/maven/plugin/internal/DefaultPluginManager.java

            }
    
            ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
            try {
                Thread.currentThread().setContextClassLoader(pluginDescriptor.getClassRealm());
    
                return container.lookup(role, roleHint);
            } finally {
                Thread.currentThread().setContextClassLoader(oldClassLoader);
            }
        }
    
    Java
    - Registered: Sun Apr 21 03:35:09 GMT 2024
    - Last Modified: Wed Sep 06 11:28:54 GMT 2023
    - 10K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java

        // certain core jdk classes.
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(NO_UNSAFE);
        try {
          runTestMethod(NO_UNSAFE);
        } finally {
          Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    
        Thread.currentThread().setContextClassLoader(NO_ATOMIC_REFERENCE_FIELD_UPDATER);
        try {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 16 03:24:50 GMT 2021
    - 6.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

        assertFalse(Thread.currentThread().isInterrupted());
        assertFalse(monitor.isOccupiedByCurrentThread());
    
        doEnterScenarioSetUp();
    
        boolean interruptedBeforeCall = Thread.currentThread().isInterrupted();
        Outcome actualOutcome = doCall();
        boolean occupiedAfterCall = monitor.isOccupiedByCurrentThread();
        boolean interruptedAfterCall = Thread.currentThread().isInterrupted();
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 14:48:57 GMT 2023
    - 27.4K bytes
    - Viewed (0)
Back to top