mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
fix: add lock for threadsafety
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -201,12 +201,15 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
private void BeginPolling()
|
private void BeginPolling()
|
||||||
{
|
{
|
||||||
if(PollTimer != null)
|
lock (_pollTimerLock)
|
||||||
{
|
{
|
||||||
return;
|
if (PollTimer != null)
|
||||||
}
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PollTimer = new Timer(o => Poll(), null, 0, PollTime);
|
PollTimer = new Timer(o => Poll(), null, 0, PollTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user