29 lines
541 B
C#
29 lines
541 B
C#
using System.Threading;
|
|
|
|
namespace StellaOps.Gateway.WebService.Services;
|
|
|
|
public sealed class GatewayServiceStatus
|
|
{
|
|
private int _started;
|
|
private int _ready;
|
|
|
|
public bool IsStarted => Volatile.Read(ref _started) == 1;
|
|
|
|
public bool IsReady => Volatile.Read(ref _ready) == 1;
|
|
|
|
public void MarkStarted()
|
|
{
|
|
Volatile.Write(ref _started, 1);
|
|
}
|
|
|
|
public void MarkReady()
|
|
{
|
|
Volatile.Write(ref _ready, 1);
|
|
}
|
|
|
|
public void MarkNotReady()
|
|
{
|
|
Volatile.Write(ref _ready, 0);
|
|
}
|
|
}
|