mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +00:00
fix: add lock for threadsafety
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
59baa74dd7
commit
60550caf99
1 changed files with 7 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue