/libcore/ojluni/src/main/java/java/util/concurrent/ |
Semaphore.java | 43 * permits. Each {@link #acquire} blocks if necessary until a permit is 111 * available, or zero permits available. When used in this way, the 120 * guarantees about the order in which threads acquire permits. In 126 * #acquire() acquire} methods are selected to obtain permits in the order in 134 * honor the fairness setting, but will take any permits that are 145 * permits at a time. These methods are generally more efficient and 148 * thread B invokes {@code s.acquire(2)}, and two permits become 169 * to represent permits. Subclassed into fair and nonfair 175 Sync(int permits) { 176 setState(permits); [all...] |
/libcore/ojluni/src/main/java/java/security/ |
AlgorithmConstraints.java | 69 public boolean permits(Set<CryptoPrimitive> primitives, method in interface:AlgorithmConstraints 87 public boolean permits(Set<CryptoPrimitive> primitives, Key key); method in interface:AlgorithmConstraints 105 public boolean permits(Set<CryptoPrimitive> primitives, method in interface:AlgorithmConstraints
|
/external/guava/guava/src/com/google/common/util/concurrent/ |
RateLimiter.java | 36 * A rate limiter. Conceptually, a rate limiter distributes permits at a 38 * available, and then takes it. Once acquired, permits need not be released. 46 * <p>A {@code RateLimiter} is defined primarily by the rate at which permits 47 * are issued. Absent additional configuration, permits will be distributed at a 48 * fixed rate, defined in terms of permits per second. Permits will be distributed 49 * smoothly, with the delay between individual permits being adjusted to ensure 53 * period during which time the permits issued each second steadily increases until 59 * final RateLimiter rateLimiter = RateLimiter.create(2.0); // rate is "2 permits per second" 70 * a rate of 5000 permits per second [all...] |
Striped.java | 229 * with the specified number of permits. 232 * @param permits the number of permits in each semaphore 235 public static Striped<Semaphore> semaphore(int stripes, final int permits) { 238 return new PaddedSemaphore(permits); 245 * with the specified number of permits. 248 * @param permits the number of permits in each semaphore 251 public static Striped<Semaphore> lazyWeakSemaphore(int stripes, final int permits) { 254 return new Semaphore(permits, false) [all...] |
SmoothRateLimiter.java | 38 * another 100ms. At this rate, serving 15 fresh permits (i.e. for an acquire(15) request) 62 * underutilization. So, the requested permits, by an invocation acquire(permits), 64 * - stored permits (if available) 65 * - fresh permits (for any remaining permits) 78 * using all the remaining 7.0 permits, and the remaining 3.0, we serve them by fresh permits 81 * We already know how much time it takes to serve 3 fresh permits: if the rate is 83 * stored permits? As explained above, there is no unique answer. If we are primaril [all...] |
Uninterruptibles.java | 302 * tryAcquire(permits, timeout, unit)} uninterruptibly. 307 Semaphore semaphore, int permits, long timeout, TimeUnit unit) { 316 return semaphore.tryAcquire(permits, remainingNanos, NANOSECONDS);
|
/libcore/ojluni/src/main/java/sun/security/util/ |
DisabledAlgorithmConstraints.java | 96 final public boolean permits(Set<CryptoPrimitive> primitives, method in class:DisabledAlgorithmConstraints 112 final public boolean permits(Set<CryptoPrimitive> primitives, Key key) { method in class:DisabledAlgorithmConstraints 121 final public boolean permits(Set<CryptoPrimitive> primitives, method in class:DisabledAlgorithmConstraints 138 public final void permits(Set<CryptoPrimitive> primitives, method in class:DisabledAlgorithmConstraints 147 public final void permits(Set<CryptoPrimitive> primitives, method in class:DisabledAlgorithmConstraints 174 if (!permits(primitives, algorithm, parameters)) { 180 if (!permits(primitives, key.getAlgorithm(), null)) { 185 return algorithmConstraints.permits(key); 199 if (!permits(primitives, algorithm, null)) { 207 if (!permits(primitives, cert.getPublicKey().getAlgorithm(), null)) 326 public boolean permits(Key key) { method in class:DisabledAlgorithmConstraints.Constraints 344 public void permits(CertConstraintParameters cp) method in class:DisabledAlgorithmConstraints.Constraints 415 public boolean permits(Key key) { method in class:DisabledAlgorithmConstraints.Constraint 425 public abstract void permits(CertConstraintParameters cp) method in class:DisabledAlgorithmConstraints.Constraint 443 public void permits(CertConstraintParameters cp) method in class:DisabledAlgorithmConstraints.jdkCAConstraint 516 public void permits(CertConstraintParameters cp) method in class:DisabledAlgorithmConstraints.KeySizeConstraint 532 public boolean permits(Key key) { method in class:DisabledAlgorithmConstraints.KeySizeConstraint [all...] |
/libcore/jsr166-tests/src/test/java/jsr166/ |
SemaphoreTest.java | 36 PublicSemaphore(int permits) { super(permits); } 37 PublicSemaphore(int permits, boolean fair) { super(permits, fair); } 107 void acquire(Semaphore s, int permits) throws InterruptedException { 108 s.acquire(permits); 117 void acquire(Semaphore s, int permits) { 118 s.acquireUninterruptibly(permits); 127 void acquire(Semaphore s, int permits) { 128 assertTrue(s.tryAcquire(permits)); [all...] |
/frameworks/support/car/src/main/java/androidx/car/moderator/ |
ContentRateLimiter.java | 32 * transparent to this class. Instead, it will refer to these actions as "permits," short for 33 * "permitted action." It is up to a user of this class to determine the unit of permits. 40 * <p>This class allows for the maximum number of permits that can be stored,the amount of permits 46 /** The maximum number of stored permits. */ 51 * 5 permits per second has a stable interval of 200ms. 61 /** Unlimited mode. Once enabled, any number of permits can be acquired and consumed. */ 70 /** Time in milliseconds when permits can resume incrementing. */ 91 * @param acquiredPermitsPerSecond The amount of permits that are acquired each second. 92 * @param maxStoredPermits The maximum number of permits that can be stored [all...] |
/art/test/004-ThreadStress/src-art/ |
Main.java | 41 // -p X .............. number of permits granted by semaphore 430 int permits = -1; local 452 permits = Integer.parseInt(args[i]); 462 Semaphore semaphore = getSemaphore(permits); 490 Semaphore semaphore = getSemaphore(permits); 508 private static Semaphore getSemaphore(int permits) { 509 if (permits == -1) { 510 // Default number of permits. 511 permits = 3; 514 Semaphore semaphore = new Semaphore(permits, /* fair */ true) [all...] |
/frameworks/support/car/src/androidTest/java/androidx/car/moderator/ |
ContentRateLimiterTest.java | 155 double permits = 2.0d; local 156 mContentRateLimiter.setAvailablePermits(permits); 157 assertEquals(permits, mContentRateLimiter.getAvailablePermits(), 0 /* delta */);
|
/prebuilts/go/darwin-x86/src/runtime/cgo/ |
sigaction.go | 15 // C/C++ code; this permits that code to see the Go runtime's existing signal
|
mmap.go | 15 // C/C++ code; this permits that code to see the Go code as normal
|
/prebuilts/go/linux-x86/src/runtime/cgo/ |
sigaction.go | 15 // C/C++ code; this permits that code to see the Go runtime's existing signal
|
mmap.go | 15 // C/C++ code; this permits that code to see the Go code as normal
|
/libcore/ojluni/src/main/java/sun/security/provider/certpath/ |
AlgorithmChecker.java | 260 // permits() will throw exception on failure. 261 ((DisabledAlgorithmConstraints)constraints).permits(primitives, method 287 if (!constraints.permits( 296 if (!constraints.permits(primitives, currPubKey)) { 306 if (!constraints.permits( 416 if (!certPathDefaultConstraints.permits(
|
/packages/apps/Camera2/src/com/android/camera/util/ |
ConcurrentSharedRingBuffer.java | 133 * A Semaphore that allows to reduce permits to negative values. 136 public NegativePermitsSemaphore(int permits) { 137 super(permits); 141 * Reduces the number of permits by <code>permits</code>. 143 * This method can only be called when number of available permits is 147 public void reducePermits(int permits) { 151 super.reducePermits(permits); 192 // Start with -1 permits to pin elements since we must always have at 511 // Release the capacity permits [all...] |
/external/guava/guava-tests/test/com/google/common/util/concurrent/ |
RateLimiterTest.java | 152 limiter.acquire(1); // R0.00, concluding a burst of 5 permits 222 // make sure the areas (times) remain the same, while permits are different 389 * amount of permits in a cool state, where X = rate * timeToCoolDown, and we have 419 private long measureTotalTimeMillis(RateLimiter rateLimiter, int permits, Random random) { 421 while (permits > 0) { 422 int nextPermitsToAcquire = Math.max(1, random.nextInt(permits)); 423 permits -= nextPermitsToAcquire;
|
/libcore/ojluni/src/main/java/sun/security/pkcs/ |
SignerInfo.java | 373 if (!JAR_DISABLED_CHECK.permits(DIGEST_PRIMITIVE_SET, 421 if (!JAR_DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, algname, null)) { 433 if (!JAR_DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, key)) { 619 if (!JAR_DISABLED_CHECK.permits(DIGEST_PRIMITIVE_SET, digestAlgname,
|
/prebuilts/go/darwin-x86/misc/cgo/test/ |
issue10303.go | 45 t.Skip("gccgo permits C pointers on the stack")
|
/prebuilts/go/linux-x86/misc/cgo/test/ |
issue10303.go | 45 t.Skip("gccgo permits C pointers on the stack")
|
/libcore/ojluni/src/main/java/java/util/stream/ |
StreamSpliterators.java | 909 private final AtomicLong permits; field in class:StreamSpliterators.AbstractWrappingSpliterator.UnorderedSliceSpliterator [all...] |
/prebuilts/go/darwin-x86/src/cmd/compile/internal/syntax/ |
nodes.go | 204 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments) 231 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments) 419 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments)
|
/prebuilts/go/linux-x86/src/cmd/compile/internal/syntax/ |
nodes.go | 204 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments) 231 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments) 419 // TODO(gri) consider using Name{"..."} instead of nil (permits attaching of comments)
|
/build/soong/zip/ |
rate_limit.go | 34 // NewRateLimit starts a new rate limiter that permits the usage of up to <capacity> at once,
|