mirror of https://github.com/Icinga/icinga2.git
Merge pull request #9738 from Icinga/TimerThreadProc
Document why Timer::TimerThreadProc() can use Timer members during Timer#~Timer() call
This commit is contained in:
commit
1665cc925e
|
@ -296,6 +296,11 @@ void Timer::TimerThreadProc()
|
|||
break;
|
||||
|
||||
auto it = idx.begin();
|
||||
|
||||
// timer->~Timer() may be called at any moment (if the last
|
||||
// smart pointer gets destroyed) or even already waiting for
|
||||
// l_TimerMutex (before doing anything else) which we have
|
||||
// locked at the moment. Until our unlock using *timer is safe.
|
||||
Timer *timer = *it;
|
||||
|
||||
ch::time_point<ch::system_clock, ch::duration<double>> next (ch::duration<double>(timer->m_Next));
|
||||
|
|
Loading…
Reference in New Issue