mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
Initial commit of SafeTimerTest, fixing bug where Trigger() was not behaving properly in net standard
This commit is contained in:
@@ -48,6 +48,9 @@ namespace ICD.Common.Utils.Timers
|
||||
/// <param name="repeatPeriod"></param>
|
||||
public SafeTimer(Action callback, long dueTime, long repeatPeriod)
|
||||
{
|
||||
if (callback == null)
|
||||
throw new ArgumentNullException("callback");
|
||||
|
||||
m_Callback = callback;
|
||||
#if SIMPLSHARP
|
||||
m_Timer = new CTimer(SafeCallback, null, dueTime, repeatPeriod);
|
||||
@@ -106,6 +109,7 @@ namespace ICD.Common.Utils.Timers
|
||||
m_Timer.Reset();
|
||||
#else
|
||||
m_Timer.Change(0, m_RepeatPeriod);
|
||||
m_Callback();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user