2021-11-27 02:10:56 +00:00
|
|
|
namespace PluralKit.Core;
|
2020-02-12 14:16:19 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public class DbConnectionCountHolder
|
2020-02-12 14:16:19 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
private int _connectionCount;
|
|
|
|
public int ConnectionCount => _connectionCount;
|
2020-02-12 14:16:19 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public void Increment()
|
|
|
|
{
|
|
|
|
Interlocked.Increment(ref _connectionCount);
|
|
|
|
}
|
2020-02-12 14:16:19 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public void Decrement()
|
|
|
|
{
|
|
|
|
Interlocked.Decrement(ref _connectionCount);
|
2020-02-12 14:16:19 +00:00
|
|
|
}
|
|
|
|
}
|