Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 61) sorted by relevance

123

/libcore/jsr166-tests/src/test/java/jsr166/
DReentrantReadWriteLockTest.java26 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.InterruptibleLockRunnable
27 InterruptibleLockRunnable(ReentrantReadWriteLock l) { lock = l; } in InterruptibleLockRunnable()
29 lock.writeLock().lockInterruptibly(); in realRun()
38 final ReentrantReadWriteLock lock; field in ReentrantReadWriteLockTest.InterruptedLockRunnable
39 InterruptedLockRunnable(ReentrantReadWriteLock l) { lock = l; } in InterruptedLockRunnable()
41 lock.writeLock().lockInterruptibly(); in realRun()
65 void releaseWriteLock(PublicReentrantReadWriteLock lock) { in releaseWriteLock() argument
66 ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); in releaseWriteLock()
67 assertWriteLockedByMoi(lock); in releaseWriteLock()
68 assertEquals(1, lock.getWriteHoldCount()); in releaseWriteLock()
[all …]
DReentrantLockTest.java25 final ReentrantLock lock; field in ReentrantLockTest.InterruptibleLockRunnable
26 InterruptibleLockRunnable(ReentrantLock l) { lock = l; } in InterruptibleLockRunnable()
28 lock.lockInterruptibly(); in realRun()
37 final ReentrantLock lock; field in ReentrantLockTest.InterruptedLockRunnable
38 InterruptedLockRunnable(ReentrantLock l) { lock = l; } in InterruptedLockRunnable()
40 lock.lockInterruptibly(); in realRun()
64 void releaseLock(PublicReentrantLock lock) { in releaseLock() argument
65 assertLockedByMoi(lock); in releaseLock()
66 lock.unlock(); in releaseLock()
67 assertFalse(lock.isHeldByCurrentThread()); in releaseLock()
[all …]
DSemaphoreTest.java40 final Semaphore lock; field in SemaphoreTest.InterruptibleLockRunnable
41 InterruptibleLockRunnable(Semaphore s) { lock = s; } in InterruptibleLockRunnable()
44 lock.acquire(); in realRun()
54 final Semaphore lock; field in SemaphoreTest.InterruptedLockRunnable
55 InterruptedLockRunnable(Semaphore s) { lock = s; } in InterruptedLockRunnable()
57 lock.acquire(); in realRun()
311 final PublicSemaphore lock = new PublicSemaphore(1, fair); in testHasQueuedThreads() local
312 assertFalse(lock.hasQueuedThreads()); in testHasQueuedThreads()
313 lock.acquireUninterruptibly(); in testHasQueuedThreads()
314 Thread t1 = newStartedThread(new InterruptedLockRunnable(lock)); in testHasQueuedThreads()
[all …]
/libcore/luni/src/main/java/java/util/concurrent/
DLinkedBlockingDeque.java126 final ReentrantLock lock = new ReentrantLock(); field in LinkedBlockingDeque
129 private final Condition notEmpty = lock.newCondition();
132 private final Condition notFull = lock.newCondition();
165 final ReentrantLock lock = this.lock; in LinkedBlockingDeque() local
166 lock.lock(); // Never contended, but necessary for visibility in LinkedBlockingDeque()
175 lock.unlock(); in LinkedBlockingDeque()
312 final ReentrantLock lock = this.lock; in offerFirst() local
313 lock.lock(); in offerFirst()
317 lock.unlock(); in offerFirst()
327 final ReentrantLock lock = this.lock; in offerLast() local
[all …]
DDelayQueue.java44 private final transient ReentrantLock lock = new ReentrantLock(); field in DelayQueue
70 private final Condition available = lock.newCondition();
108 final ReentrantLock lock = this.lock; in offer() local
109 lock.lock(); in offer()
118 lock.unlock(); in offer()
155 final ReentrantLock lock = this.lock; in poll() local
156 lock.lock(); in poll()
164 lock.unlock(); in poll()
176 final ReentrantLock lock = this.lock; in take() local
177 lock.lockInterruptibly(); in take()
[all …]
DArrayBlockingQueue.java80 final ReentrantLock lock; field in ArrayBlockingQueue
226 lock = new ReentrantLock(fair); in ArrayBlockingQueue()
227 notEmpty = lock.newCondition(); in ArrayBlockingQueue()
228 notFull = lock.newCondition(); in ArrayBlockingQueue()
251 final ReentrantLock lock = this.lock; in ArrayBlockingQueue() local
252 lock.lock(); // Lock only for visibility, not mutual exclusion in ArrayBlockingQueue()
266 lock.unlock(); in ArrayBlockingQueue()
296 final ReentrantLock lock = this.lock; in offer() local
297 lock.lock(); in offer()
306 lock.unlock(); in offer()
[all …]
DCyclicBarrier.java123 private final ReentrantLock lock = new ReentrantLock(); field in CyclicBarrier
125 private final Condition trip = lock.newCondition();
168 final ReentrantLock lock = this.lock; in dowait() local
169 lock.lock(); in dowait()
228 lock.unlock(); in dowait()
413 final ReentrantLock lock = this.lock; in isBroken() local
414 lock.lock(); in isBroken()
418 lock.unlock(); in isBroken()
432 final ReentrantLock lock = this.lock; in reset() local
433 lock.lock(); in reset()
[all …]
DPriorityBlockingQueue.java127 private final ReentrantLock lock; field in PriorityBlockingQueue
184 this.lock = new ReentrantLock(); in PriorityBlockingQueue()
185 this.notEmpty = lock.newCondition(); in PriorityBlockingQueue()
207 this.lock = new ReentrantLock(); in PriorityBlockingQueue()
208 this.notEmpty = lock.newCondition(); in PriorityBlockingQueue()
250 lock.unlock(); // must release and then re-acquire main lock in tryGrow()
273 lock.lock(); in tryGrow()
441 final ReentrantLock lock = this.lock; in offer() local
442 lock.lock(); in offer()
456 lock.unlock(); in offer()
[all …]
DScheduledThreadPoolExecutor.java805 private final ReentrantLock lock = new ReentrantLock(); field in ScheduledThreadPoolExecutor.DelayedWorkQueue
830 private final Condition available = lock.newCondition();
912 final ReentrantLock lock = this.lock; in contains() local
913 lock.lock(); in contains()
917 lock.unlock(); in contains()
922 final ReentrantLock lock = this.lock; in remove() local
923 lock.lock(); in remove()
940 lock.unlock(); in remove()
945 final ReentrantLock lock = this.lock; in size() local
946 lock.lock(); in size()
[all …]
/libcore/luni/src/main/java/java/io/
DFilterReader.java56 synchronized (lock) { in close()
79 synchronized (lock) { in mark()
96 synchronized (lock) { in markSupported()
113 synchronized (lock) { in read()
129 synchronized (lock) { in read()
147 synchronized (lock) { in ready()
167 synchronized (lock) { in reset()
187 synchronized (lock) { in skip()
DReader.java43 protected Object lock; field in Reader
50 lock = this; in Reader()
62 protected Reader(Object lock) { in Reader() argument
63 if (lock == null) { in Reader()
66 this.lock = lock; in Reader()
123 synchronized (lock) { in read()
207 synchronized (lock) { in skip()
DWriter.java41 protected Object lock; field in Writer
48 lock = this; in Writer()
60 protected Writer(Object lock) { in Writer() argument
61 if (lock == null) { in Writer()
64 this.lock = lock; in Writer()
125 synchronized (lock) { in write()
166 synchronized (lock) { in write()
DCharArrayWriter.java49 lock = buf; in CharArrayWriter()
67 lock = buf; in CharArrayWriter()
104 synchronized (lock) { in reset()
117 synchronized (lock) { in size()
130 synchronized (lock) { in toCharArray()
146 synchronized (lock) { in toString()
168 synchronized (lock) { in write()
185 synchronized (lock) { in write()
210 synchronized (lock) { in write()
230 synchronized (lock) { in writeTo()
DLineNumberReader.java68 synchronized (lock) { in getLineNumber()
91 synchronized (lock) { in mark()
116 synchronized (lock) { in read()
149 synchronized (lock) { in read()
185 synchronized (lock) { in readLine()
212 synchronized (lock) { in reset()
230 synchronized (lock) { in setLineNumber()
256 synchronized (lock) { in skip()
DFilterWriter.java57 synchronized (lock) { in close()
71 synchronized (lock) { in flush()
91 synchronized (lock) { in write()
107 synchronized (lock) { in write()
128 synchronized (lock) { in write()
DCharArrayReader.java102 synchronized (lock) {
140 synchronized (lock) {
177 synchronized (lock) {
200 synchronized (lock) {
226 synchronized (lock) {
243 synchronized (lock) {
260 synchronized (lock) {
DStringReader.java89 synchronized (lock) { in mark()
124 synchronized (lock) { in read()
146 synchronized (lock) { in read()
175 synchronized (lock) { in ready()
194 synchronized (lock) { in reset()
222 synchronized (lock) { in skip()
DPushbackReader.java85 synchronized (lock) { in close()
137 synchronized (lock) { in read()
173 synchronized (lock) { in read()
220 synchronized (lock) { in ready()
294 synchronized (lock) { in unread()
321 synchronized (lock) { in unread()
345 synchronized (lock) { in skip()
/libcore/luni/src/main/java/java/util/
DTimerTask.java29 final Object lock = new Object(); field in TimerTask
51 synchronized (lock) { in getWhen()
60 synchronized (lock) { in setScheduledTime()
72 synchronized (lock) { in isScheduled()
92 synchronized (lock) { in cancel()
107 synchronized (lock) { in scheduledExecutionTime()
/libcore/support/src/test/java/tests/support/
DSupport_StringWriter.java34 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()
DSupport_StringReader.java54 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DFileChannelLockingTest.java89 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 …]
DFileLockTest.java105 FileLock lock = new MockFileLock(null, 0, 10, true); in test_channel() local
106 assertNull(lock.channel()); in test_channel()
141 FileLock lock = new MockFileLock(null, 0, 10, true); in test_isShared() local
142 assertTrue(lock.isShared()); in test_isShared()
163 FileLock fileLock = readWriteChannel.lock(); in test_isValid()
177 FileLock fileLock = fileChannel.lock(); in test_release()
189 fileLock = fileChannel.lock(); in test_release()
/libcore/luni/src/test/java/libcore/java/lang/
DOldAndroidMonitorTest.java295 private static void deepWait(int depth, Object lock) { in deepWait() argument
296 synchronized (lock) { in deepWait()
298 deepWait(depth - 1, lock); in deepWait()
303 lock.wait(); in deepWait()
313 Object lock; field in OldAndroidMonitorTest.Worker
316 Worker(int id, Object lock) { in Worker() argument
319 this.lock = lock; in Worker()
326 OldAndroidMonitorTest.deepWait(id, lock); in run()
362 synchronized (w[j].lock) { in testNestedMonitors()
363 w[j].lock.notify(); in testNestedMonitors()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DThreadTest.java425 final Object lock = new Object(); in test_getThreadGroup() local
429 synchronized (lock) { in test_getThreadGroup()
430 lock.notifyAll(); in test_getThreadGroup()
434 synchronized (lock) { in test_getThreadGroup()
437 lock.wait(); in test_getThreadGroup()
453 final Object lock = new Object(); in test_interrupt() local
462 synchronized (lock) { in test_interrupt()
463 lock.notify(); in test_interrupt()
465 lock.wait(); in test_interrupt()
483 synchronized (lock) { in test_interrupt()
[all …]

123