Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 351 for acquire (0.2 sec)

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

        limiter.acquire(Integer.MAX_VALUE / 4);
        limiter.acquire(Integer.MAX_VALUE / 2);
        limiter.acquire(Integer.MAX_VALUE);
        assertEvents("R0.00", "R0.00", "R0.00"); // no wait, infinite rate!
    
        limiter.setRate(2.0);
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        assertEvents(
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/RateLimiter.java

       */
      @CanIgnoreReturnValue
      public double acquire() {
        return acquire(1);
      }
    
      /**
       * Acquires the given number of permits from this {@code RateLimiter}, blocking until the request
       * can be granted. Tells the amount of time slept, if any.
       *
       * @param permits the number of permits to acquire
       * @return time spent sleeping to enforce rate, in seconds; 0.0 if not rate-limited
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 18.2K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

     *
     * <p>Deadlocks can arise when locks are acquired in an order that forms a cycle. In a simple
     * example involving two locks and two threads, deadlock occurs when one thread acquires Lock A, and
     * then Lock B, while another thread acquires Lock B, and then Lock A:
     *
     * <pre>
     * Thread1: acquire(LockA) --X acquire(LockB)
     * Thread2: acquire(LockB) --X acquire(LockA)
     * </pre>
     *
    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)
  4. android/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java

       * evaluate the integral of the function from 7.0 to 10.0.
       *
       * Using integrals guarantees that the effect of a single acquire(3) is equivalent to {
       * acquire(1); acquire(1); acquire(1); }, or { acquire(2); acquire(1); }, etc, since the integral
       * of the function in [7.0, 10.0] is equivalent to the sum of the integrals of [7.0, 8.0], [8.0,
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 19.3K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/Monitor.java

        } finally {
          if (!satisfied) {
            leave();
          }
        }
      }
    
      /**
       * Enters this monitor when the guard is satisfied. Blocks at most the given time, including both
       * the time to acquire the lock and the time to wait for the guard to be satisfied, and may be
       * interrupted.
       *
       * @return whether the monitor was entered, which guarantees that the guard is now satisfied
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 18:22:01 GMT 2023
    - 38.6K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/escape/EscapersTest.java

        assertEquals("<hello><hi><lo>", charEscaper.escape("x\uD800\uDC00"));
        assertEquals("<hello><hi><lo>", unicodeEscaper.escape("x\uD800\uDC00"));
    
        // Test that wrapped escapers acquire good Unicode semantics.
        assertEquals("<hi><hello><lo>", charEscaper.escape("\uD800x\uDC00"));
        try {
          unicodeEscaper.escape("\uD800x\uDC00");
          fail("should have failed for bad Unicode input");
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

         * <p>To avoid races between threads doing release and acquire, we transition to the final state
         * in two steps. One thread will successfully CAS from RUNNING to COMPLETING, that thread will
         * then set the result of the computation, and only then transition to COMPLETED, CANCELLED, or
         * INTERRUPTED.
         *
         * <p>We don't use the integer argument passed between acquire methods so we pass around a -1
         * everywhere.
         */
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed May 09 15:17:25 GMT 2018
    - 13.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

         * <p>To avoid races between threads doing release and acquire, we transition to the final state
         * in two steps. One thread will successfully CAS from RUNNING to COMPLETING, that thread will
         * then set the result of the computation, and only then transition to COMPLETED, CANCELLED, or
         * INTERRUPTED.
         *
         * <p>We don't use the integer argument passed between acquire methods so we pass around a -1
         * everywhere.
         */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 13.6K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/AbstractFuture.java

       * cancelled without a call to {@code cancel}, such as by calling {@code
       * setFuture(cancelledFuture)}.
       *
       * <p>Beware of completing a future while holding a lock. Its listeners may do slow work or
       * acquire other locks, risking deadlocks.
       */
      @CanIgnoreReturnValue
      @Override
      public boolean cancel(boolean mayInterruptIfRunning) {
        Object localValue = value;
        boolean rValue = false;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 22 21:17:24 GMT 2024
    - 63K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        limiter.acquire(Integer.MAX_VALUE / 4);
        limiter.acquire(Integer.MAX_VALUE / 2);
        limiter.acquire(Integer.MAX_VALUE);
        assertEvents("R0.00", "R0.00", "R0.00"); // no wait, infinite rate!
    
        limiter.setRate(2.0);
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        limiter.acquire();
        assertEvents(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
Back to top