mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
fix: add lock for threadsafety
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -200,6 +200,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void BeginPolling()
|
private void BeginPolling()
|
||||||
|
{
|
||||||
|
lock (_pollTimerLock)
|
||||||
{
|
{
|
||||||
if (PollTimer != null)
|
if (PollTimer != null)
|
||||||
{
|
{
|
||||||
@@ -208,6 +210,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
PollTimer = new Timer(o => Poll(), null, 0, PollTime);
|
PollTimer = new Timer(o => Poll(), null, 0, PollTime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop the poll cycle
|
/// Stop the poll cycle
|
||||||
|
|||||||
Reference in New Issue
Block a user