|
◆ ScopeGuardAtomic() [2/2]
Construct a ScopeGuardAtomic for the specified item.
It is set to the "executionVal" value at this point. When the destructor is invoked, it is set to the specified exitVal value.
- Note
- The value in the item is not protected during the existence of this object. It is set to executionVal when this object is constructed and set back to its initial value when the object is destroyed, but nothing prevents it being changed while the object exists, and in that case, the changed value is overwritten when this object is destroyed.
- Parameters
-
item | The item to be guarded. The type of this must be an instantiation of std::atomic |
executionVal | The value that should be placed in the item when this constructed is executed. The type of this must be type used to instantiate std::atomic when constructing item. |
exitVal | The value to be put in the item when this object is destroyed. The type of this must be type used to instantiate std::atomic when constructing item. |
References drama::CreateRunDramaTask().
|