|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.util.thread.ConditionalLock
public class ConditionalLock
Allows a thread to pause waiting for a state set by another thread.
Constructor Summary | |
---|---|
ConditionalLock()
Creates a new conditional in the default state of false. |
|
ConditionalLock(boolean state)
Creates a new conditional in the specified state. |
Method Summary | |
---|---|
boolean |
isTrue()
Returns true if the conditional currently represents a true state. |
void |
setFalse()
Sets the conditional to the false state. |
void |
setState(boolean state)
Sets the state to the specified value. |
void |
setTrue()
Sets the conditional to the true state. |
void |
waitForFalse()
Waits for the state to become false. |
void |
waitForFalse(long timeout)
Waits for the state to become false for the specified milliseconds. |
void |
waitForTrue()
Waits for the state to become true. |
void |
waitForTrue(long timeout)
Waits for the state to become true for the specified milliseconds. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConditionalLock()
public ConditionalLock(boolean state)
Method Detail |
---|
public boolean isTrue()
public void setFalse()
public void setTrue()
public void setState(boolean state)
public void waitForTrue(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForTrue() throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForFalse(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForFalse() throws java.lang.InterruptedException
java.lang.InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |