Macros implementations for the Atomic type
Macros implementations for the Atomic type
Constructs an Atomic[T]
reference.
Constructs an Atomic[T]
reference.
Based on the initialValue
, it will return the best, most
specific type. E.g. you give it a number, it will return
something inheriting from AtomicNumber[T]
. That's why it takes
an AtomicBuilder[T, R]
as an implicit parameter - but worry
not about such details as it just works.
is the initial value with which to initialize the Atomic reference
is the builder that helps us to build the
best reference possible, based on our initialValue
Returns the builder that would be chosen to construct Atomic
references for the given initialValue
.
Constructs an Atomic[T]
reference, applying the provided
PaddingStrategy in order to counter the "false sharing"
problem.
Constructs an Atomic[T]
reference, applying the provided
PaddingStrategy in order to counter the "false sharing"
problem.
Based on the initialValue
, it will return the best, most
specific type. E.g. you give it a number, it will return
something inheriting from AtomicNumber[T]
. That's why it takes
an AtomicBuilder[T, R]
as an implicit parameter - but worry
not about such details as it just works.
Note that for Scala.js we aren't applying any padding, as it doesn't make much sense, since Javascript execution is single threaded, but this builder is provided for syntax compatibility anyway across the JVM and Javascript and we never know how Javascript engines will evolve.
is the initial value with which to initialize the Atomic reference
is the PaddingStrategy to apply
is the builder that helps us to build the
best reference possible, based on our initialValue