Home
last modified time | relevance | path

Searched refs:tryLock (Results 1 – 25 of 26) sorted by relevance

12

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DFileChannelLockingTest.java159 readOnlyChannel.tryLock(); in test_tryLock()
169 readOnlyChannel.tryLock(0, 99, false); in test_tryLockLLZ()
177 readOnlyChannel.tryLock(-99, 0, true); in test_tryLockLLZ()
184 FileLock tmpLock = readOnlyChannel.tryLock(0, 10, true); in test_tryLockLLZ()
189 FileLock lock = readOnlyChannel.tryLock(10, 788, true); in test_tryLockLLZ()
194 readOnlyChannel.tryLock(1, 23, true); in test_tryLockLLZ()
201 FileLock adjacentLock = readOnlyChannel.tryLock(1, 3, true); in test_tryLockLLZ()
DFileChannelTest.java886 readOnlyFileChannel.tryLock(); in test_tryLock_Closed()
892 writeOnlyFileChannel.tryLock(); in test_tryLock_Closed()
898 readWriteFileChannel.tryLock(); in test_tryLock_Closed()
908 readOnlyFileChannel.tryLock(); in test_tryLock_NonWritable()
917 fileLock = writeOnlyFileChannel.tryLock(); in test_tryLock()
929 fileLock = writeOnlyFileChannel.tryLock(); in test_tryLock_Overlapping()
934 writeOnlyFileChannel.tryLock(); in test_tryLock_Overlapping()
940 writeOnlyFileChannel2.tryLock(); in test_tryLock_Overlapping()
949 fileLock = writeOnlyFileChannel.tryLock(); in test_tryLock_After_Release()
953 fileLock = writeOnlyFileChannel.tryLock(); in test_tryLock_After_Release()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DLock.java263 boolean tryLock(); in tryLock() method
323 boolean tryLock(long time, TimeUnit unit) throws InterruptedException; in tryLock() method
DReentrantLock.java373 public boolean tryLock() { in tryLock() method in ReentrantLock
449 public boolean tryLock(long timeout, TimeUnit unit) in tryLock() method in ReentrantLock
DReentrantReadWriteLock.java800 public boolean tryLock() { in tryLock() method in ReentrantReadWriteLock.ReadLock
871 public boolean tryLock(long timeout, TimeUnit unit) in tryLock() method in ReentrantReadWriteLock.ReadLock
1037 public boolean tryLock() { in tryLock() method in ReentrantReadWriteLock.WriteLock
1120 public boolean tryLock(long timeout, TimeUnit unit) in tryLock() method in ReentrantReadWriteLock.WriteLock
DStampedLock.java884 public boolean tryLock() { return tryReadLock() != 0L; } in tryLock() method in StampedLock.ReadLockView
885 public boolean tryLock(long time, TimeUnit unit) in tryLock() method in StampedLock.ReadLockView
900 public boolean tryLock() { return tryWriteLock() != 0L; } in tryLock() method in StampedLock.WriteLockView
901 public boolean tryLock(long time, TimeUnit unit) in tryLock() method in StampedLock.WriteLockView
/libcore/ojluni/src/main/java/java/nio/channels/
DAsynchronousFileChannel.java606 public abstract FileLock tryLock(long position, long size, boolean shared) in tryLock() method in AsynchronousFileChannel
639 public final FileLock tryLock() throws IOException { in tryLock() method in AsynchronousFileChannel
640 return tryLock(0L, Long.MAX_VALUE, false); in tryLock()
DFileChannel.java1122 public abstract FileLock tryLock(long position, long size, boolean shared) in tryLock() method in FileChannel
1154 public final FileLock tryLock() throws IOException { in tryLock() method in FileChannel
1155 return tryLock(0L, Long.MAX_VALUE, false); in tryLock()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DStampedLockTest.java105 lockers.add(() -> lock.tryLock()); in lockLockers()
106 lockers.add(() -> lock.tryLock(Long.MIN_VALUE, DAYS)); in lockLockers()
107 lockers.add(() -> lock.tryLock(0L, DAYS)); in lockLockers()
108 lockers.add(() -> lock.tryLock(Long.MAX_VALUE, DAYS)); in lockLockers()
313 () -> lock.asWriteLock().tryLock(0L, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWhenPreInterrupted()
314 () -> lock.asWriteLock().tryLock(Long.MAX_VALUE, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWhenPreInterrupted()
316 () -> lock.asReadLock().tryLock(0L, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWhenPreInterrupted()
317 () -> lock.asReadLock().tryLock(Long.MAX_VALUE, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWhenPreInterrupted()
376 () -> lock.asWriteLock().tryLock(Long.MAX_VALUE, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWriteLockedInterrupted()
378 () -> lock.asReadLock().tryLock(Long.MAX_VALUE, DAYS), in testInterruptibleOperationsThrowInterruptedExceptionWriteLockedInterrupted()
[all …]
DReentrantReadWriteLockTest.java364 lock.writeLock().tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testWriteTryLock_Interruptible()
404 lock.readLock().tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testReadTryLock_Interruptible()
421 assertTrue(lock.writeLock().tryLock()); in testWriteTryLock()
423 assertTrue(lock.writeLock().tryLock()); in testWriteTryLock()
440 assertFalse(lock.writeLock().tryLock()); in testWriteTryLockWhenLocked()
458 assertFalse(lock.readLock().tryLock()); in testReadTryLockWhenLocked()
475 assertTrue(lock.readLock().tryLock()); in testMultipleReadLocks()
477 assertTrue(lock.readLock().tryLock(LONG_DELAY_MS, MILLISECONDS)); in testMultipleReadLocks()
620 assertTrue(lock.readLock().tryLock()); in testReadHoldingWriteLock()
655 lock.readLock().tryLock(); in testReadTryLockBarging()
[all …]
DReentrantLockTest.java254 assertTrue(lock.tryLock()); in testTryLock()
256 assertTrue(lock.tryLock()); in testTryLock()
397 lock.tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testTryLock_Interruptible()
416 assertFalse(lock.tryLock()); in testTryLockWhenLocked()
435 assertFalse(lock.tryLock(timeoutMillis, MILLISECONDS)); in testTryLock_Timeout()
DForkJoinPoolTest.java126 return hasLock || (hasLock = lock.tryLock()); in isReleasable()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DOldFileChannelTest.java209 writeOnlyFileChannel.tryLock(0, -1, false); in test_tryLockJJZ_IllegalArgument()
216 writeOnlyFileChannel.tryLock(-1, 0, false); in test_tryLockJJZ_IllegalArgument()
223 readWriteFileChannel.tryLock(-1, -1, false); in test_tryLockJJZ_IllegalArgument()
230 readWriteFileChannel.tryLock(Long.MAX_VALUE, 1, false); in test_tryLockJJZ_IllegalArgument()
239 FileLock lock = readWriteFileChannel.tryLock(tooBig, 1, false); in testTryLockVeryLarge()
243 lock = readWriteFileChannel.tryLock(0, tooBig, false); in testTryLockVeryLarge()
249 FileLock lockOne = readWriteFileChannel.tryLock(0, 10, false); in testTryLockOverlapping()
250 FileLock lockTwo = readWriteFileChannel.tryLock(10, 20, false); in testTryLockOverlapping()
254 lockOne = readWriteFileChannel.tryLock(0, 10, false); in testTryLockOverlapping()
1073 readWriteFileChannel.tryLock(position, size, false); in assertLockFails()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/locks/
DReentrantLock.java59 public boolean tryLock() { in tryLock() method in ReentrantLock
63 public boolean tryLock(long timeout, java.util.concurrent.TimeUnit unit) in tryLock() method in ReentrantLock
/libcore/jsr166-tests/src/test/java/jsr166/
DReentrantReadWriteLockTest.java341 lock.writeLock().tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testWriteTryLock_Interruptible()
381 lock.readLock().tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testReadTryLock_Interruptible()
398 assertTrue(lock.writeLock().tryLock()); in testWriteTryLock()
400 assertTrue(lock.writeLock().tryLock()); in testWriteTryLock()
417 assertFalse(lock.writeLock().tryLock()); in testWriteTryLockWhenLocked()
435 assertFalse(lock.readLock().tryLock()); in testReadTryLockWhenLocked()
452 assertTrue(lock.readLock().tryLock()); in testMultipleReadLocks()
454 assertTrue(lock.readLock().tryLock(LONG_DELAY_MS, MILLISECONDS)); in testMultipleReadLocks()
597 assertTrue(lock.readLock().tryLock()); in testReadHoldingWriteLock()
632 lock.readLock().tryLock(); in testReadTryLockBarging()
[all …]
DStampedLockTest.java845 assertFalse(lock.tryLock()); in testAsWriteLock()
847 assertTrue(lock.tryLock()); in testAsWriteLock()
858 assertTrue(lock.tryLock()); in testAsReadLock()
868 assertFalse(lock.tryLock()); in testAsReadWriteLockWriteLock()
870 assertTrue(lock.tryLock()); in testAsReadWriteLockWriteLock()
881 assertTrue(lock.tryLock()); in testAsReadWriteLockReadLock()
DReentrantLockTest.java231 assertTrue(lock.tryLock()); in testTryLock()
233 assertTrue(lock.tryLock()); in testTryLock()
374 lock.tryLock(2 * LONG_DELAY_MS, MILLISECONDS); in testTryLock_Interruptible()
393 assertFalse(lock.tryLock()); in testTryLockWhenLocked()
412 assertFalse(lock.tryLock(timeoutMillis, MILLISECONDS)); in testTryLock_Timeout()
DForkJoinPoolTest.java108 return hasLock || (hasLock = lock.tryLock()); in isReleasable()
/libcore/ojluni/src/main/java/java/util/concurrent/
DThreadPoolExecutor.java668 public boolean tryLock() { return tryAcquire(1); } in tryLock() method in ThreadPoolExecutor.Worker
812 if (!t.isInterrupted() && w.tryLock()) { in interruptIdleWorkers()
DForkJoinTask.java633 if (lock.tryLock()) { in helpExpungeStaleExceptions()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DThreadPoolExecutor.java480 public boolean tryLock() { in tryLock() method in ThreadPoolExecutor.Worker
/libcore/ojluni/src/main/java/sun/nio/ch/
DSimpleAsynchronousFileChannelImpl.java243 public FileLock tryLock(long position, long size, boolean shared) in tryLock() method in SimpleAsynchronousFileChannelImpl
DFileChannelImpl.java1164 public FileLock tryLock(long position, long size, boolean shared) in tryLock() method in FileChannelImpl
/libcore/ojluni/annotations/hiddenapi/sun/nio/ch/
DFileChannelImpl.java199 public java.nio.channels.FileLock tryLock(long position, long size, boolean shared) in tryLock() method in FileChannelImpl
/libcore/ojluni/src/main/java/java/util/logging/
DFileHandler.java497 available = lockFileChannel.tryLock() != null; in openFiles()

12