protected class LockService.LockImpl
extends java.lang.Object
implements java.util.concurrent.locks.Lock
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicReference<java.lang.Thread> |
holder |
protected java.lang.String |
name |
| Constructor and Description |
|---|
LockImpl(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
lock() |
void |
lockInterruptibly() |
java.util.concurrent.locks.Condition |
newCondition()
This condition object is only allowed to work 1 for each lock.
|
boolean |
tryLock() |
boolean |
tryLock(long time,
java.util.concurrent.TimeUnit unit) |
void |
unlock() |
protected final java.lang.String name
protected final java.util.concurrent.atomic.AtomicReference<java.lang.Thread> holder
public void lock()
lock in interface java.util.concurrent.locks.Lockpublic void lockInterruptibly()
throws java.lang.InterruptedException
lockInterruptibly in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic boolean tryLock()
tryLock in interface java.util.concurrent.locks.Lockpublic boolean tryLock(long time,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
tryLock in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic void unlock()
unlock in interface java.util.concurrent.locks.Lockpublic java.util.concurrent.locks.Condition newCondition()
newCondition in interface java.util.concurrent.locks.LockCopyright ? 1998-2009 Bela Ban / Red Hat. All Rights Reserved.