public abstract class STMUtils extends Object
| Constructor and Description |
|---|
STMUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
dereference(GlobalReference<T> reference)
Returns referenced value or null if the reference is null.
|
static <T extends SemiPersistent<T>> |
inTransaction(Memory<T> memory)
Returns
true if the current code is being executed within a transaction. |
static <T> GlobalReference<T> |
reference(Memory<?> memory,
GlobalReference<T> globalReference,
T value)
Either updates the
GlobalReference and returns it or, if the source is null, creates a new
GlobalReference with the given value and returns it. |
public static <T> GlobalReference<T> reference(Memory<?> memory, GlobalReference<T> globalReference, T value)
GlobalReference and returns it or, if the source is null, creates a new
GlobalReference with the given value and returns it.T - The referenced value type.memory - The transactional memory.globalReference - The global reference to be updated or null.value - The value to be assigned.GlobalReference as in the argument but with value changed or a new
GlobalReference with the given value.public static <T> T dereference(GlobalReference<T> reference)
T - The referenced value type.reference - The GlobalReference to dereference.public static <T extends SemiPersistent<T>> boolean inTransaction(Memory<T> memory)
true if the current code is being executed within a transaction.T - The memory root type.memory - The STM Memory instance.true if called from within a transaction.MemoryException - if this method is called from a committed block.Copyright © 2013 CERN, The European Organization for Nuclear Research. All Rights Reserved.