Searched defs:tryAcquire (Results 1 - 9 of 9) sorted by relevance

/libcore/ojluni/src/main/java/java/util/concurrent/
H A DSemaphore.java133 * Also note that the untimed {@link #tryAcquire() tryAcquire} methods do not
356 * fair ordering policy, a call to {@code tryAcquire()} <em>will</em>
362 * {@link #tryAcquire(long, TimeUnit) tryAcquire(0, TimeUnit.SECONDS) }
368 public boolean tryAcquire() { method in class:Semaphore
413 public boolean tryAcquire(long timeout, TimeUnit unit) method in class:Semaphore
520 * policy, a call to {@code tryAcquire} <em>will</em>
525 * honor the fairness setting, then use {@link #tryAcquire(int,
526 * long, TimeUnit) tryAcquire(permit
534 public boolean tryAcquire(int permits) { method in class:Semaphore
589 public boolean tryAcquire(int permits, long timeout, TimeUnit unit) method in class:Semaphore
[all...]
H A DThreadPoolExecutor.java653 protected boolean tryAcquire(int unused) { method in class:ThreadPoolExecutor.Worker
668 public boolean tryLock() { return tryAcquire(1); }
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
H A DReentrantLock.java127 * Performs non-fair tryLock. tryAcquire is implemented in
213 protected final boolean tryAcquire(int acquires) { method in class:ReentrantLock.NonfairSync
229 * Fair version of tryAcquire. Don't grant access unless
232 protected final boolean tryAcquire(int acquires) { method in class:ReentrantLock.FairSync
H A DReentrantReadWriteLock.java365 * Note that tryRelease and tryAcquire can be called by
368 * condition wait and re-established in tryAcquire.
382 protected final boolean tryAcquire(int acquires) { method in class:ReentrantReadWriteLock.Sync
554 * This is identical in effect to tryAcquire except for lack
H A DAbstractQueuedLongSynchronizer.java411 * cancel if tryAcquire throws exception) and other control, at
428 if (p == head && tryAcquire(arg)) {
453 if (p == head && tryAcquire(arg)) {
484 if (p == head && tryAcquire(arg)) {
633 protected boolean tryAcquire(long arg) { method in class:AbstractQueuedLongSynchronizer
745 * by invoking at least once {@link #tryAcquire},
748 * #tryAcquire} until success. This method can be used
752 * {@link #tryAcquire} but is otherwise uninterpreted and
756 if (!tryAcquire(arg) &&
764 * at least once {@link #tryAcquire}, returnin
[all...]
H A DAbstractQueuedSynchronizer.java113 * <li>{@link #tryAcquire}
139 * while (!tryAcquire(arg)) {
154 * define {@code tryAcquire} and/or {@code tryAcquireShared} to
157 * In particular, most fair synchronizers can define {@code tryAcquire}
170 * invocations of {@code tryAcquire} interspersed with other
209 * public boolean tryAcquire(int acquires) {
242 * public boolean tryLock() { return sync.tryAcquire(1); }
877 * cancel if tryAcquire throws exception) and other control, at
894 if (p == head && tryAcquire(arg)) {
919 if (p == head && tryAcquire(ar
1099 protected boolean tryAcquire(int arg) { method in class:AbstractQueuedSynchronizer
[all...]
/libcore/jsr166-tests/src/test/java/jsr166/
H A DAbstractQueuedLongSynchronizerTest.java51 public boolean tryAcquire(long acquires) { method in class:AbstractQueuedLongSynchronizerTest.Mutex
66 public boolean tryAcquire() { method in class:AbstractQueuedLongSynchronizerTest.Mutex
67 return tryAcquire(LOCKED);
293 * tryAcquire on a released sync succeeds
297 assertTrue(sync.tryAcquire());
527 * tryAcquire on exclusively held sync fails
534 assertFalse(sync.tryAcquire());
H A DAbstractQueuedSynchronizerTest.java54 @Override public boolean tryAcquire(int acquires) { method in class:AbstractQueuedSynchronizerTest.Mutex
70 public boolean tryAcquire() { method in class:AbstractQueuedSynchronizerTest.Mutex
71 return tryAcquire(LOCKED);
296 * tryAcquire on a released sync succeeds
300 assertTrue(sync.tryAcquire());
530 * tryAcquire on exclusively held sync fails
537 assertFalse(sync.tryAcquire());
H A DSemaphoreTest.java121 tryAcquire() { method in enum:SemaphoreTest.AcquireMethod
123 assertTrue(s.tryAcquire());
128 assertTrue(s.tryAcquire(permits));
133 assertTrue(s.tryAcquire(2 * LONG_DELAY_MS, MILLISECONDS));
138 assertTrue(s.tryAcquire(permits, 2 * LONG_DELAY_MS, MILLISECONDS));
180 * tryAcquire succeeds when sufficient permits, else fails
187 assertTrue(s.tryAcquire());
188 assertTrue(s.tryAcquire());
190 assertFalse(s.tryAcquire());
191 assertFalse(s.tryAcquire());
[all...]

Completed in 111 milliseconds