using System;
namespace Swan.Threading
{
///
/// Represents an atomic TimeSpan type.
///
public sealed class AtomicTimeSpan : AtomicTypeBase
{
///
/// Initializes a new instance of the class.
///
/// The initial value.
public AtomicTimeSpan(TimeSpan initialValue)
: base(initialValue.Ticks)
{
// placeholder
}
///
protected override TimeSpan FromLong(long backingValue) => TimeSpan.FromTicks(backingValue);
///
protected override long ToLong(TimeSpan value) => value.Ticks < 0 ? 0 : value.Ticks;
}
}