Home | History | Annotate | Download | only in concurrent

Lines Matching defs:lock

120  *     private final ReentrantLock lock = new ReentrantLock();
121 * private final Condition valuePresent = lock.newCondition();
122 * private final Condition valueAbsent = lock.newCondition();
126 * lock.lock();
136 * lock.unlock();
141 * lock.lock();
149 * lock.unlock();
209 // guard.lock();
233 // it's the same lock being acquired underneath. Always using
235 // which lock is held at any point in the code.
246 // since, after all, this class is also a reentrant mutual exclusion lock!?
261 * to be non-satisfied before reacquiring the lock, and that other thread takes over the
273 * corresponding thread may have already been interrupted and is waiting to reacquire the lock
296 @GuardedBy("monitor.lock")
300 @GuardedBy("monitor.lock")
305 this.condition = monitor.lock.newCondition();
323 * The lock underlying this monitor.
325 private final ReentrantLock lock;
331 @GuardedBy("lock")
350 this.lock = new ReentrantLock(fair);
357 lock.lock();
364 lock.lockInterruptibly();
374 final ReentrantLock lock = this.lock;
375 if (!fair && lock.tryLock()) {
383 return lock.tryLock(timeoutNanos, TimeUnit.NANOSECONDS);
402 return lock.tryLock(time, unit);
413 return lock.tryLock();
423 final ReentrantLock lock = this.lock;
424 boolean signalBeforeWaiting = lock.isHeldByCurrentThread();
425 lock.lockInterruptibly();
447 final ReentrantLock lock = this.lock;
448 boolean signalBeforeWaiting = lock.isHeldByCurrentThread();
449 lock.lock();
466 * the time to acquire the lock and the time to wait for the guard to be satisfied, and may be
476 final ReentrantLock lock = this.lock;
477 boolean reentrant = lock.isHeldByCurrentThread();
478 if (fair || !lock.tryLock()) {
480 if (!lock.tryLock(time, unit)) {
500 lock.unlock();
508 * both the time to acquire the lock and the time to wait for the guard to be satisfied.
517 final ReentrantLock lock = this.lock;
519 boolean signalBeforeWaiting = lock.isHeldByCurrentThread();
522 if (fair || !lock.tryLock()) {
526 locked = lock.tryLock(timeoutNanos, TimeUnit.NANOSECONDS);
551 lock.unlock(); // No need to signal if timed out
562 * Enters this monitor if the guard is satisfied. Blocks indefinitely acquiring the lock, but
571 final ReentrantLock lock = this.lock;
572 lock.lock();
579 lock.unlock();
585 * Enters this monitor if the guard is satisfied. Blocks indefinitely acquiring the lock, but does
594 final ReentrantLock lock = this.lock;
595 lock.lockInterruptibly();
602 lock.unlock();
609 * lock, but does not wait for the guard to be satisfied.
626 lock.unlock();
633 * lock, but does not wait for the guard to be satisfied, and may be interrupted.
642 final ReentrantLock lock = this.lock;
643 if (!lock.tryLock(time, unit)) {
652 lock.unlock();
659 * block acquiring the lock and does not wait for the guard to be satisfied.
669 final ReentrantLock lock = this.lock;
670 if (!lock.tryLock()) {
679 lock.unlock();
689 if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
702 if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
718 if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
732 if (!((guard.monitor == this) & lock.isHeldByCurrentThread())) {
765 final ReentrantLock lock = this.lock;
767 // No need to signal if we will still be holding the lock when we return
768 if (lock.getHoldCount() == 1) {
772 lock.unlock(); // Will throw IllegalMonitorStateException if not held
788 return lock.isLocked();
796 return lock.isHeldByCurrentThread();
804 return lock.getHoldCount();
814 return lock.getQueueLength();
824 return lock.hasQueuedThreads();
834 return lock.hasQueuedThread(thread);
857 lock.lock();
861 lock.unlock();
870 * the current thread is about to relinquish the lock and may have changed the state protected by
874 * responsibility of signalling the next thread when it again relinquishes the lock. Unlike a
881 * happen due to spurious wakeup (ignorable) or another thread acquiring the lock before the
889 @GuardedBy("lock")
907 // @GuardedBy("lock")
921 @GuardedBy("lock")
934 @GuardedBy("lock")
944 @GuardedBy("lock")
957 @GuardedBy("lock")
982 @GuardedBy("lock")
998 @GuardedBy("lock")
1013 @GuardedBy("lock")