@Internal
public interface Barrier
Barriers must be lowered in a finally
block so as to avoid blocking operations forever.
Modifier and Type | Method and Description |
---|---|
void |
await()
Blocks the calling thread until the barrier is lowered or the calling thread is interrupted.
|
void |
lower()
Lowers the barrier.
|
void |
lowerThenRaise()
Lower the barrier to allow waiting threads through, then immediately raise it again.
|
String |
name()
Returns this barrier's name.
|
void |
raise()
Raises the barrier.
|
String name()
void await()
Thread.isInterrupted()
to check if the thread has been interrupted.void raise()
await()
when the barrier is raised will block indefinitely until
the barrier is lowered again.void lower()
await()
will no longer be blocked.void lowerThenRaise()
Copyright © 2002-2019 Atlassian. All Rights Reserved.