com.atlassian.jira.concurrent.Barrier |
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
The barrier allows us to hold up an operation for a short while. This class is not API and should only be used for testing.
Barriers must be lowered in a finally
block so as to avoid blocking operations forever.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Blocks the calling thread until the barrier is lowered or the calling thread is interrupted.
| |||||||||||
Lowers the barrier.
| |||||||||||
Lower the barrier to allow waiting threads through, then immediately raise it again.
| |||||||||||
Returns this barrier's name.
| |||||||||||
Raises the barrier.
|
Blocks the calling thread until the barrier is lowered or the calling thread is interrupted. Callers may use
isInterrupted()
to check if the thread has been interrupted.
Lowers the barrier. Any threads that are blocked on await()
will no longer be blocked.
Lower the barrier to allow waiting threads through, then immediately raise it again. Waiting threads are only allowed through once. This is useful for stepping through loops containing a barrier.
Raises the barrier. Threads that call await()
when the barrier is raised will block indefinitely until
the barrier is lowered again.