2021-08-27 15:03:47 +00:00
|
|
|
using System.Threading;
|
2020-02-12 14:16:19 +00:00
|
|
|
|
|
|
|
namespace PluralKit.Core
|
|
|
|
{
|
|
|
|
public class DbConnectionCountHolder
|
|
|
|
{
|
|
|
|
private int _connectionCount;
|
|
|
|
public int ConnectionCount => _connectionCount;
|
|
|
|
|
|
|
|
public void Increment()
|
|
|
|
{
|
|
|
|
Interlocked.Increment(ref _connectionCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Decrement()
|
|
|
|
{
|
|
|
|
Interlocked.Decrement(ref _connectionCount);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|