Пример #1
0
 public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
   return sync.tryAcquireNanos(1, unit.toNanos(timeout));
 }
Пример #2
0
 public Thread getLockOwner() {
   return sync.getLockOwner();
 }
Пример #3
0
 public boolean hasQueuedThreads() {
   return sync.hasQueuedThreads();
 }
Пример #4
0
 public void lockInterruptibly() throws InterruptedException {
   sync.acquireInterruptibly(1);
 }
Пример #5
0
 public boolean isLocked() {
   return sync.isHeldExclusively();
 }
Пример #6
0
 public Condition newCondition() {
   return sync.newCondition();
 }
Пример #7
0
 public void unlock() {
   sync.release(1);
 }
Пример #8
0
 public boolean tryLock() {
   return sync.tryAcquire(1);
 }
Пример #9
0
 public void lock() {
   sync.acquire(1);
 }