|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--serp.util.ThreadLock
Lock implementation. The lock is aware of the thread that owns it, and
allows that thread to lock()
multiple times without blocking. Only
the owning thread can unlock()
, and the lock will not be released to
other threads until unlock()
has been called the same number of
times as lock()
.
Using this lock is similar to synchronizing on an object, but is more
flexible (for example, the calls to lock()
and unlock()
can
be surrounded by if statements).
Note that the lock resets on serialization.
Constructor Summary | |
ThreadLock()
|
Method Summary | |
boolean |
isLocked()
Return true if this lock is locked. |
void |
lock()
Atomically lock. |
boolean |
lock(long timeout)
Atomically lock. |
void |
unlock()
Releases the lock. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public ThreadLock()
Method Detail |
public void lock()
public boolean lock(long timeout)
public void unlock()
IllegalStateException
- if current thread is not ownerpublic boolean isLocked()
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |