mirror of https://github.com/Icinga/icinga2.git
Support multiple redundant Timer#Start() calls
so that only the first one changes l_AliveTimers (as in Timer#Stop()).
This commit is contained in:
parent
298f3b1973
commit
c41e5fd05d
|
@ -162,12 +162,13 @@ double Timer::GetInterval() const
|
|||
void Timer::Start()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(l_TimerMutex);
|
||||
m_Started = true;
|
||||
|
||||
if (++l_AliveTimers == 1) {
|
||||
if (!m_Started && ++l_AliveTimers == 1) {
|
||||
InitializeThread();
|
||||
}
|
||||
|
||||
m_Started = true;
|
||||
|
||||
InternalRescheduleUnlocked(false, m_Interval > 0 ? -1 : m_Next);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue