diff --git a/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs b/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs index 5bc505e2..d012ff2c 100644 --- a/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs +++ b/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs @@ -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); + } } ///