trait AtomicUpdater[U, W] extends AnyRef
- Self Type
- AtomicUpdater[U, W] with U
- Alphabetic
- By Inheritance
- AtomicUpdater
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract val updater: AtomicReferenceFieldUpdater[U, W]
Concrete 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
-
final
def
atomicUpdate(f: (W) ⇒ W): W
Recursive, atomic updates.
Recursive, atomic updates. If there is an unguaranteed update of atomicity, it may loop indefinitely.
- f
Update function.
- Attributes
- protected
- Annotations
- @tailrec()
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compareAndSet(o: W, n: W): Boolean
Update only if the existing data is in the expected state.
Update only if the existing data is in the expected state. If it is not in the expected state, it will not be updated.
- o
Expected symbol.
- n
Update symbol.
- Attributes
- protected
-
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] )
-
def
get: W
Returns a new reference that is the result of the snapshot.
Returns a new reference that is the result of the snapshot.
- Attributes
- protected
-
def
getAndSet(n: W): W
Atomically sets the field of the given object managed by this updater to the given value and returns the old value.
Atomically sets the field of the given object managed by this updater to the given value and returns the old value.
- n
the new value
- returns
the previous value
- Attributes
- protected
-
def
getAndUpdate(nf: UnaryOperator[W]): W
Atomically updates the field of the given object managed by this updater with the results of applying the given function, returning the previous value.
Atomically updates the field of the given object managed by this updater with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.
- nf
a side-effect-free function
- returns
the previous value
- Attributes
- protected
- Since
1.8
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getRef: W
Gets the current value held in the field of the given object managed by this updater.
Gets the current value held in the field of the given object managed by this updater.
- returns
the current value
- Attributes
- protected
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
def
set(n: W): Unit
Sets the field of the given object managed by this updater to the given updated value.
Sets the field of the given object managed by this updater to the given updated value. This operation is guaranteed to act as a volatile store with respect to subsequent invocations of compareAndSet.
- n
the new value
- Attributes
- protected
-
def
snapshot(w: W): W
Provides a way to create a snapshot if necessary.
Provides a way to create a snapshot if necessary. Usually not processed.
In that case, response is a reference, so if you change it, it may affect the value that other threads reference. To prevent this, use snapshot or compareAndSet to override snapshot and update.
override def snapshot(w: W): W = w.snapshot() val old = getRef val newRef = get newRef.update(x -> y) compareAndSet(old, newRef)
- w
value type
- Attributes
- protected
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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()