Searched refs:tryAcquire (Results 1 - 7 of 7) sorted by relevance

/dalvik/libcore/concurrent/src/test/java/tests/api/java/util/concurrent/
H A DSemaphoreTest.java97 * tryAcquire succeeds when sufficient permits, else fails
102 assertTrue(s.tryAcquire());
103 assertTrue(s.tryAcquire());
105 assertFalse(s.tryAcquire());
159 assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
161 assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
163 assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
165 assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
167 assertTrue(s.tryAcquire(SHORT_DELAY_MS, TimeUnit.MILLISECONDS));
243 threadAssertTrue(s.tryAcquire(SHORT_DELAY_M
[all...]
H A DAbstractQueuedSynchronizerTest.java36 public boolean tryAcquire(int acquires) { method in class:AbstractQueuedSynchronizerTest.Mutex
117 * tryAcquire on an released sync succeeds
121 assertTrue(rl.tryAcquire(1));
386 threadAssertFalse(sync.tryAcquire(1));
/dalvik/libcore/concurrent/src/main/java/java/util/concurrent/
H A DSemaphore.java106 * Also note that the untimed {@link #tryAcquire() tryAcquire} methods do not
323 * fair ordering policy, a call to {@code tryAcquire()} <em>will</em>
329 * {@link #tryAcquire(long, TimeUnit) tryAcquire(0, TimeUnit.SECONDS) }
335 public boolean tryAcquire() { method in class:Semaphore
380 public boolean tryAcquire(long timeout, TimeUnit unit) method in class:Semaphore
484 * policy, a call to {@code tryAcquire} <em>will</em>
489 * honor the fairness setting, then use {@link #tryAcquire(int,
490 * long, TimeUnit) tryAcquire(permit
498 public boolean tryAcquire(int permits) { method in class:Semaphore
553 public boolean tryAcquire(int permits, long timeout, TimeUnit unit) method in class:Semaphore
[all...]
H A DThreadPoolExecutor.java573 protected boolean tryAcquire(int unused) { method in class:ThreadPoolExecutor.Worker
588 public boolean tryLock() { return tryAcquire(1); }
/dalvik/libcore/concurrent/src/main/java/java/util/concurrent/locks/
H A DReentrantLock.java100 * Performs non-fair tryLock. tryAcquire is
188 protected final boolean tryAcquire(int acquires) { method in class:ReentrantLock.NonfairSync
204 * Fair version of tryAcquire. Don't grant access unless
207 protected final boolean tryAcquire(int acquires) { method in class:ReentrantLock.FairSync
H A DAbstractQueuedSynchronizer.java83 * <li> {@link #tryAcquire}
103 * while (!tryAcquire(arg)) {
118 * define <tt>tryAcquire</tt> and/or <tt>tryAcquireShared</tt> to
121 * In particular, most fair synchronizers can define <tt>tryAcquire</tt>
133 * invocations of <tt>tryAcquire</tt> interspersed with other
169 * public boolean tryAcquire(int acquires) {
197 * public boolean tryLock() { return sync.tryAcquire(1); }
799 * cancel if tryAcquire throws exception) and other control, at
817 if (p == head && tryAcquire(arg)) {
844 if (p == head && tryAcquire(ar
1030 protected boolean tryAcquire(int arg) { method in class:AbstractQueuedSynchronizer
[all...]
H A DReentrantReadWriteLock.java336 * Note that tryRelease and tryAcquire can be called by
339 * condition wait and re-established in tryAcquire.
353 protected final boolean tryAcquire(int acquires) { method in class:ReentrantReadWriteLock.Sync
525 * This is identical in effect to tryAcquire except for lack

Completed in 70 milliseconds