using System; using Unosquare.Swan.Abstractions; namespace Unosquare.Swan { /// /// Represents an atomically readable or writable integer. /// public class AtomicInteger : AtomicTypeBase { /// /// Initializes a new instance of the class. /// /// if set to true [initial value]. public AtomicInteger(Int32 initialValue = default) : base(Convert.ToInt64(initialValue)) { // placeholder } /// protected override Int32 FromLong(Int64 backingValue) => Convert.ToInt32(backingValue); /// protected override Int64 ToLong(Int32 value) => Convert.ToInt64(value); } }