Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for ThreadLocal (0.22 sec)

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

       *
       * <p>This class would certainly be simpler and easier to reason about if it were built with
       * ThreadLocal; however, ThreadLocal is not well optimized for the case where the ThreadLocal is
       * non-static, and is initialized/removed frequently - this causes churn in the Thread specific
       * hashmaps. Using a static ThreadLocal to avoid that overhead would mean that different
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 22.1K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

       */
      // This is logically a Set, but an ArrayList is used to minimize the amount
      // of allocation done on lock()/unlock().
      private static final ThreadLocal<ArrayList<LockGraphNode>> acquiredLocks =
          new ThreadLocal<ArrayList<LockGraphNode>>() {
            @Override
            protected ArrayList<LockGraphNode> initialValue() {
              return Lists.<LockGraphNode>newArrayListWithCapacity(3);
            }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 35.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/SourceSinkFactories.java

      }
    
      private abstract static class FileFactory {
    
        private static final Logger logger = Logger.getLogger(FileFactory.class.getName());
    
        private final ThreadLocal<File> fileThreadLocal = new ThreadLocal<>();
    
        protected File createFile() throws IOException {
          File file = File.createTempFile("SinkSourceFile", "txt");
          fileThreadLocal.set(file);
          return file;
        }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Sep 09 17:57:59 GMT 2021
    - 17.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/hash/Striped64.java

          }
        }
      }
    
      /**
       * ThreadLocal holding a single-slot int array holding hash code. Unlike the JDK8 version of this
       * class, we use a suboptimal int[] representation to avoid introducing a new type that can impede
       * class-unloading when ThreadLocals are not removed.
       */
      static final ThreadLocal<int @Nullable []> threadHashCode = new ThreadLocal<>();
    
      /** Generator of new random hash codes */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

          };
    
      public void testDirectExecutorServiceServiceInThreadExecution() throws Exception {
        final ListeningExecutorService executor = newDirectExecutorService();
        final ThreadLocal<Integer> threadLocalCount =
            new ThreadLocal<Integer>() {
              @Override
              protected Integer initialValue() {
                return 0;
              }
            };
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  6. android/guava-tests/test/com/google/common/hash/BloomFilterTest.java

     *
     * @author Dimitris Andreou
     */
    public class BloomFilterTest extends TestCase {
      private static final int NUM_PUTS = 100_000;
      private static final ThreadLocal<Random> random =
          new ThreadLocal<Random>() {
            @Override
            protected Random initialValue() {
              return new Random();
            }
          };
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
  7. guava-gwt/src-super/com/google/common/escape/super/com/google/common/escape/Platform.java

    package com.google.common.escape;
    
    /** @author Jesse Wilson */
    final class Platform {
    
      private static final char[] CHAR_BUFFER = new char[1024];
    
      static char[] charBufferFromThreadLocal() {
        // ThreadLocal is not available to GWT, so we always reuse the same
        // instance.  It is always safe to return the same instance because
        // javascript is single-threaded, and only used by blocks that doesn't
        // involve async callbacks.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 1.1K bytes
    - Viewed (0)
  8. guava/src/com/google/common/cache/Striped64.java

          }
        }
      }
    
      /**
       * ThreadLocal holding a single-slot int array holding hash code. Unlike the JDK8 version of this
       * class, we use a suboptimal int[] representation to avoid introducing a new type that can impede
       * class-unloading when ThreadLocals are not removed.
       */
      static final ThreadLocal<int @Nullable []> threadHashCode = new ThreadLocal<>();
    
      /** Generator of new random hash codes */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/cache/Striped64.java

          }
        }
      }
    
      /**
       * ThreadLocal holding a single-slot int array holding hash code. Unlike the JDK8 version of this
       * class, we use a suboptimal int[] representation to avoid introducing a new type that can impede
       * class-unloading when ThreadLocals are not removed.
       */
      static final ThreadLocal<int @Nullable []> threadHashCode = new ThreadLocal<>();
    
      /** Generator of new random hash codes */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/hash/BloomFilterTest.java

     *
     * @author Dimitris Andreou
     */
    public class BloomFilterTest extends TestCase {
      private static final int NUM_PUTS = 100_000;
      private static final ThreadLocal<Random> random =
          new ThreadLocal<Random>() {
            @Override
            protected Random initialValue() {
              return new Random();
            }
          };
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 21.3K bytes
    - Viewed (0)
Back to top