mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +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()
|
||||
{
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user