/libcore/jsr166-tests/src/test/java/jsr166/ |
D | ReentrantReadWriteLockTest.java | 41 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.InterruptibleLockRunnable 42 InterruptibleLockRunnable(ReentrantReadWriteLock l) { lock = l; } in InterruptibleLockRunnable() 44 lock.writeLock().lockInterruptibly(); in realRun() 53 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.InterruptedLockRunnable 54 InterruptedLockRunnable(ReentrantReadWriteLock l) { lock = l; } in InterruptedLockRunnable() 56 lock.writeLock().lockInterruptibly(); in realRun() 80 void releaseWriteLock(PublicReentrantReadWriteLock lock) { in releaseWriteLock() argument 81 ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); in releaseWriteLock() 82 assertWriteLockedByMoi(lock); in releaseWriteLock() 83 assertEquals(1, lock.getWriteHoldCount()); in releaseWriteLock() [all …]
|
D | ReentrantLockTest.java | 40 final ReentrantLock lock; field in ReentrantLockTest.InterruptibleLockRunnable 41 InterruptibleLockRunnable(ReentrantLock lock) { this.lock = lock; } in InterruptibleLockRunnable() argument 43 lock.lockInterruptibly(); in realRun() 52 final ReentrantLock lock; field in ReentrantLockTest.InterruptedLockRunnable 53 InterruptedLockRunnable(ReentrantLock lock) { this.lock = lock; } in InterruptedLockRunnable() argument 55 lock.lockInterruptibly(); in realRun() 79 void releaseLock(PublicReentrantLock lock) { in releaseLock() argument 80 assertLockedByMoi(lock); in releaseLock() 81 lock.unlock(); in releaseLock() 82 assertFalse(lock.isHeldByCurrentThread()); in releaseLock() [all …]
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | ReentrantLockTest.java | 63 final ReentrantLock lock; field in ReentrantLockTest.InterruptibleLockRunnable 64 InterruptibleLockRunnable(ReentrantLock lock) { this.lock = lock; } in InterruptibleLockRunnable() argument 66 lock.lockInterruptibly(); in realRun() 75 final ReentrantLock lock; field in ReentrantLockTest.InterruptedLockRunnable 76 InterruptedLockRunnable(ReentrantLock lock) { this.lock = lock; } in InterruptedLockRunnable() argument 78 lock.lockInterruptibly(); in realRun() 102 void releaseLock(PublicReentrantLock lock) { in releaseLock() argument 103 assertLockedByMoi(lock); in releaseLock() 104 lock.unlock(); in releaseLock() 105 assertFalse(lock.isHeldByCurrentThread()); in releaseLock() [all …]
|
D | SemaphoreTest.java | 76 final Semaphore lock; field in SemaphoreTest.InterruptibleLockRunnable 77 InterruptibleLockRunnable(Semaphore s) { lock = s; } in InterruptibleLockRunnable() 80 lock.acquire(); in realRun() 90 final Semaphore lock; field in SemaphoreTest.InterruptedLockRunnable 91 InterruptedLockRunnable(Semaphore s) { lock = s; } in InterruptedLockRunnable() 93 lock.acquire(); in realRun() 347 final PublicSemaphore lock = new PublicSemaphore(1, fair); in testHasQueuedThreads() local 348 assertFalse(lock.hasQueuedThreads()); in testHasQueuedThreads() 349 lock.acquireUninterruptibly(); in testHasQueuedThreads() 350 Thread t1 = newStartedThread(new InterruptedLockRunnable(lock)); in testHasQueuedThreads() [all …]
|
/libcore/luni/src/test/java/libcore/java/util/concurrent/ |
D | ReentrantReadWriteLockTest.java | 35 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.ReadLockRunnable 37 ReadLockRunnable(ReentrantReadWriteLock lock) { in ReadLockRunnable() argument 38 this.lock = lock; in ReadLockRunnable() 43 lock.readLock().lock(); in run() 44 lock.readLock().unlock(); in run() 49 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.WriteLockRunnable 51 WriteLockRunnable(ReentrantReadWriteLock lock) { in WriteLockRunnable() argument 52 this.lock = lock; in WriteLockRunnable() 57 lock.writeLock().lock(); in run() 58 lock.writeLock().unlock(); in run() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | DelayQueue.java | 79 private final transient ReentrantLock lock = new ReentrantLock(); field in DelayQueue 105 private final Condition available = lock.newCondition(); 143 final ReentrantLock lock = this.lock; in offer() local 144 lock.lock(); in offer() 153 lock.unlock(); in offer() 190 final ReentrantLock lock = this.lock; in poll() local 191 lock.lock(); in poll() 198 lock.unlock(); in poll() 210 final ReentrantLock lock = this.lock; in take() local 211 lock.lockInterruptibly(); in take() [all …]
|
D | LinkedBlockingDeque.java | 158 final ReentrantLock lock = new ReentrantLock(); field in LinkedBlockingDeque 161 private final Condition notEmpty = lock.newCondition(); 164 private final Condition notFull = lock.newCondition(); 197 final ReentrantLock lock = this.lock; in LinkedBlockingDeque() local 198 lock.lock(); // Never contended, but necessary for visibility in LinkedBlockingDeque() 207 lock.unlock(); in LinkedBlockingDeque() 344 final ReentrantLock lock = this.lock; in offerFirst() local 345 lock.lock(); in offerFirst() 349 lock.unlock(); in offerFirst() 359 final ReentrantLock lock = this.lock; in offerLast() local [all …]
|
D | CyclicBarrier.java | 157 private final ReentrantLock lock = new ReentrantLock(); field in CyclicBarrier 159 private final Condition trip = lock.newCondition(); 202 final ReentrantLock lock = this.lock; in dowait() local 203 lock.lock(); in dowait() 262 lock.unlock(); in dowait() 448 final ReentrantLock lock = this.lock; in isBroken() local 449 lock.lock(); in isBroken() 453 lock.unlock(); in isBroken() 467 final ReentrantLock lock = this.lock; in reset() local 468 lock.lock(); in reset() [all …]
|
D | PriorityBlockingQueue.java | 166 private final ReentrantLock lock; field in PriorityBlockingQueue 223 this.lock = new ReentrantLock(); in PriorityBlockingQueue() 224 this.notEmpty = lock.newCondition(); in PriorityBlockingQueue() 246 this.lock = new ReentrantLock(); in PriorityBlockingQueue() 247 this.notEmpty = lock.newCondition(); in PriorityBlockingQueue() 289 lock.unlock(); // must release and then re-acquire main lock in tryGrow() 311 lock.lock(); in tryGrow() 479 final ReentrantLock lock = this.lock; in offer() local 480 lock.lock(); in offer() 494 lock.unlock(); in offer() [all …]
|
D | ScheduledThreadPoolExecutor.java | 878 private final ReentrantLock lock = new ReentrantLock(); field in ScheduledThreadPoolExecutor.DelayedWorkQueue 903 private final Condition available = lock.newCondition(); 985 final ReentrantLock lock = this.lock; in contains() local 986 lock.lock(); in contains() 990 lock.unlock(); in contains() 995 final ReentrantLock lock = this.lock; in remove() local 996 lock.lock(); in remove() 1013 lock.unlock(); in remove() 1018 final ReentrantLock lock = this.lock; in size() local 1019 lock.lock(); in size() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | ObjectTest.java | 24 final Object lock = new Object(); field in ObjectTest 36 synchronized (lock) { in setUp() 43 synchronized (lock) { in tearDown() 119 synchronized (lock) { in test_notify() 122 lock.wait(); // Wait to be notified. in test_notify() 125 lock.wait(); in test_notify() 152 synchronized (lock) { in test_notify() 157 lock.wait(100, 0); in test_notify() 166 lock.notify(); in test_notify() 168 lock.wait(100); // Sleep for 100 msecs, releasing lock. in test_notify() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | OldAndroidMonitorTest.java | 111 private final Object lock; field in OldAndroidMonitorTest.Waiter 115 public Waiter(Object lock, CountDownLatch cdl) { in Waiter() argument 116 this.lock = lock; in Waiter() 123 synchronized (lock) { in run() 127 lock.wait(); in run() 136 synchronized (lock) { in wasInterrupted() 143 final Object lock = new Object(); in testInterrupt() local 145 final Waiter waiter = new Waiter(lock, cdl); in testInterrupt() 158 synchronized (lock) { in testInterrupt()
|
/libcore/support/src/test/java/tests/support/ |
D | Support_StringWriter.java | 34 lock = buf; in Support_StringWriter() 45 lock = buf; in Support_StringWriter() 79 synchronized (lock) { in getBuffer() 93 synchronized (lock) { in toString() 117 synchronized (lock) { in write() 136 synchronized (lock) { in write() 151 synchronized (lock) { in write() 174 synchronized (lock) { in write()
|
D | Support_StringReader.java | 54 synchronized (lock) { in close() 82 synchronized (lock) { in mark() 119 synchronized (lock) { in read() 152 synchronized (lock) { in read() 187 synchronized (lock) { in ready() 206 synchronized (lock) { in reset() 229 synchronized (lock) { in skip()
|
/libcore/ojluni/src/main/java/java/net/ |
D | InMemoryCookieStore.java | 69 private ReentrantLock lock = null; field in InMemoryCookieStore 83 lock = new ReentrantLock(false); in InMemoryCookieStore() 97 lock.lock(); in add() 105 lock.unlock(); in add() 125 lock.lock(); in get() 132 lock.unlock(); in get() 145 lock.lock(); in getCookies() 160 lock.unlock(); in getCookies() 195 lock.lock(); in getURIs() 201 lock.unlock(); in getURIs() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/ |
D | FileChannelLockingTest.java | 89 readOnlyChannel.lock(); in test_illegalLocks() 97 writeOnlyChannel.lock(1, 10, true); in test_illegalLocks() 106 FileLock flock = readWriteChannel.lock(); in test_lockReadWrite() 115 readOnlyChannel.lock(-1, 10, true); in test_illegalLockParameters() 121 writeOnlyChannel.lock(-1, 10, false); in test_illegalLockParameters() 127 readWriteChannel.lock(-1, 10, false); in test_illegalLockParameters() 134 FileLock flock1 = readWriteChannel.lock(22, 110, true); in test_illegalLockParameters() 138 readWriteChannel.lock(75, 210, true); in test_illegalLockParameters() 147 FileLock flock1 = readWriteChannel.lock(0, 10, false); in test_lockLLZ() 150 FileLock flock2 = readWriteChannel.lock(22, 100, true); in test_lockLLZ() [all …]
|
/libcore/ojluni/src/main/java/java/io/ |
D | Writer.java | 69 protected Object lock; field in Writer 76 this.lock = this; in Writer() 86 protected Writer(Object lock) { in Writer() argument 87 if (lock == null) { in Writer() 90 this.lock = lock; in Writer() 108 synchronized (lock) { in write() 181 synchronized (lock) { in write()
|
D | Reader.java | 60 protected Object lock; field in Reader 67 this.lock = this; in Reader() 76 protected Reader(Object lock) { in Reader() argument 77 if (lock == null) { in Reader() 80 this.lock = lock; in Reader() 180 synchronized (lock) { in skip()
|
D | PrintWriter.java | 318 synchronized (lock) { in flush() 336 synchronized (lock) { in close() 403 synchronized (lock) { in write() 424 synchronized (lock) { in write() 454 synchronized (lock) { in write() 478 synchronized (lock) { in newLine() 640 synchronized (lock) { in println() 654 synchronized (lock) { in println() 668 synchronized (lock) { in println() 682 synchronized (lock) { in println() [all …]
|
D | StringReader.java | 68 synchronized (lock) { in read() 89 synchronized (lock) { in read() 123 synchronized (lock) { in skip() 143 synchronized (lock) { in ready() 173 synchronized (lock) { in mark() 186 synchronized (lock) { in reset()
|
D | LineNumberReader.java | 125 synchronized (lock) { in read() 165 synchronized (lock) { in read() 200 synchronized (lock) { in readLine() 233 synchronized (lock) { in skip() 261 synchronized (lock) { in mark() 276 synchronized (lock) { in reset()
|
/libcore/ojluni/src/main/java/java/lang/ref/ |
D | ReferenceQueue.java | 51 private final Object lock = new Object(); field in ReferenceQueue 100 synchronized (lock) { in isEnqueued() 113 synchronized (lock) { in enqueue() 115 lock.notifyAll(); in enqueue() 151 synchronized (lock) { in poll() 185 synchronized (lock) { in remove() 190 lock.wait(timeout); in remove() 236 synchronized (queue.lock) { in enqueuePending() 248 queue.lock.notifyAll(); in enqueuePending()
|
/libcore/ojluni/src/main/java/sun/nio/fs/ |
D | Cancellable.java | 42 private final Object lock = new Object(); field in Cancellable 75 synchronized (lock) { in cancel() 87 synchronized (lock) { in exception() 97 synchronized (lock) { in run() 101 synchronized (lock) { in run()
|
/libcore/ojluni/src/main/java/sun/nio/cs/ |
D | StreamDecoder.java | 63 Object lock, in forInputStreamReader() argument 72 return new StreamDecoder(in, lock, Charset.forName(csn)); in forInputStreamReader() 78 Object lock, in forInputStreamReader() argument 81 return new StreamDecoder(in, lock, cs); in forInputStreamReader() 85 Object lock, in forInputStreamReader() argument 88 return new StreamDecoder(in, lock, dec); in forInputStreamReader() 120 synchronized (lock) { in read0() 150 synchronized (lock) { in read() 186 synchronized (lock) { in ready() 193 synchronized (lock) { in close() [all …]
|
D | StreamEncoder.java | 50 Object lock, in forOutputStreamWriter() argument 59 return new StreamEncoder(out, lock, Charset.forName(csn)); in forOutputStreamWriter() 65 Object lock, in forOutputStreamWriter() argument 68 return new StreamEncoder(out, lock, cs); in forOutputStreamWriter() 72 Object lock, in forOutputStreamWriter() argument 75 return new StreamEncoder(out, lock, enc); in forOutputStreamWriter() 102 synchronized (lock) { in flushBuffer() 117 synchronized (lock) { in write() 139 synchronized (lock) { in flush() 146 synchronized (lock) { in close() [all …]
|