|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.util.BlockLock
BlockLock - allows one thread to hold and release another efficiently. Warning: having multiple threads call block could result in bizzarre behaviour. Calling block after unblock will have no effect and return immediately, since a BlockLock is only good for a one time usage.
Constructor Summary | |
BlockLock()
creates a new BlockLock. |
Method Summary | |
void |
block()
thread that wants to block calls this |
boolean |
blockForTime(long time)
blocks for a certain maximum time period. |
void |
unblock()
unblocks the thread that called block() |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public BlockLock()
Method Detail |
public void block()
public boolean blockForTime(long time)
time
- - the time in milliseconds to wait before timing outpublic void unblock()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |