mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Document why Timer::TimerThreadProc() can use Timer members during Timer#~Timer() call
This commit is contained in:
parent
66b039df9c
commit
335688909b
@ -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…
x
Reference in New Issue
Block a user