class AtomicBarrier extends AnyRef
An atomic barrier is similar to a countdown latch, except that the content is a state transition system with semantic meaning instead of a simple counter.
It is designed with a single writer ("unblocker") thread and a single reader ("waiter") thread in mind. It is concurrency safe with more writers and readers, but using more is likely to cause race conditions for legal transitions. That is to say, trying to perform an otherwise legal transition twice is illegal and may occur if there is more than one unblocker or waiter thread. Having additional passive state observers that only call load() is never an issue.
Legal transitions are: - BLOCKED -> UNBLOCKED - BLOCKED -> REQUESTED - REQUESTED -> UNBLOCKED - UNBLOCKED -> PASSED
- Alphabetic
- By Inheritance
- AtomicBarrier
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new AtomicBarrier()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
load(): State
Get the current state.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AtomicBarrier → AnyRef → Any
-
def
unblock(): Unit
Transition to the Unblocked state.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
waitToPass(): Unit
Wait until this barrier can be passed and then mark it as Passed.