Got at least one data fetching method working; turns out, we can't use a patched LogicStack to get the data
This commit is contained in:
28
Vendor/Swan.Lite-3.1.0/Threading/AtomicInteger.cs
vendored
Normal file
28
Vendor/Swan.Lite-3.1.0/Threading/AtomicInteger.cs
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace Swan.Threading
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an atomically readable or writable integer.
|
||||
/// </summary>
|
||||
public class AtomicInteger : AtomicTypeBase<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AtomicInteger"/> class.
|
||||
/// </summary>
|
||||
/// <param name="initialValue">if set to <c>true</c> [initial value].</param>
|
||||
public AtomicInteger(int initialValue = default)
|
||||
: base(Convert.ToInt64(initialValue))
|
||||
{
|
||||
// placeholder
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override int FromLong(long backingValue) =>
|
||||
Convert.ToInt32(backingValue);
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override long ToLong(int value) =>
|
||||
Convert.ToInt64(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user