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 afinally
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.
| |||||||||||
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.
Raises the barrier. Threads that call await()
when the barrier is raised will block indefinitely until
the barrier is lowered again.