mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
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()
|
void Timer::Start()
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lock(l_TimerMutex);
|
std::unique_lock<std::mutex> lock(l_TimerMutex);
|
||||||
m_Started = true;
|
|
||||||
|
|
||||||
if (++l_AliveTimers == 1) {
|
if (!m_Started && ++l_AliveTimers == 1) {
|
||||||
InitializeThread();
|
InitializeThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_Started = true;
|
||||||
|
|
||||||
InternalRescheduleUnlocked(false, m_Interval > 0 ? -1 : m_Next);
|
InternalRescheduleUnlocked(false, m_Interval > 0 ? -1 : m_Next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user