RaspberryIO_26/Swan.Lite/Threading/AtomicLong.cs

23 lines
721 B
C#
Raw Normal View History

2019-12-08 19:54:52 +01:00
using System;
namespace Swan.Threading {
/// <summary>
/// Fast, atomic long combining interlocked to write value and volatile to read values.
/// </summary>
public sealed class AtomicLong : AtomicTypeBase<Int64> {
2019-12-04 18:57:18 +01:00
/// <summary>
2019-12-08 19:54:52 +01:00
/// Initializes a new instance of the <see cref="AtomicLong"/> class.
2019-12-04 18:57:18 +01:00
/// </summary>
2019-12-08 19:54:52 +01:00
/// <param name="initialValue">if set to <c>true</c> [initial value].</param>
public AtomicLong(Int64 initialValue = default) : base(initialValue) {
// placeholder
}
/// <inheritdoc />
protected override Int64 FromLong(Int64 backingValue) => backingValue;
/// <inheritdoc />
protected override Int64 ToLong(Int64 value) => value;
}
2019-12-04 18:57:18 +01:00
}