java.lang.Object | |
↳ | android.os.ConditionVariable |
Class that implements the condition variable locking paradigm.
This differs from the built-in java.lang.Object wait() and notify() in that this class contains the condition to wait on itself. That means open(), close() and block() are sticky. If open() is called before block(), block() will not block, and instead return immediately.
This class uses itself as the object to wait on, so if you wait() or notify() on a ConditionVariable, the results are undefined.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create the ConditionVariable in the default closed state.
| |||||||||||
Create the ConditionVariable with the given state.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Block the current thread until the condition is opened or until
timeout milliseconds have passed.
| |||||||||||
Block the current thread until the condition is opened.
| |||||||||||
Reset the condition to the closed state.
| |||||||||||
Open the condition, and release all threads that are blocked.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create the ConditionVariable in the default closed state.
Create the ConditionVariable with the given state.
Pass true for opened and false for closed.
Block the current thread until the condition is opened or until timeout milliseconds have passed.
If the condition is already opened, return immediately.
timeout | the minimum time to wait in milliseconds. |
---|
Block the current thread until the condition is opened.
If the condition is already opened, return immediately.
Reset the condition to the closed state.
Any threads that call block() will block until someone calls open.
Open the condition, and release all threads that are blocked.
Any threads that later approach block() will not block unless close() is called.