示例#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);
 }