MCPcopy Create free account
hub / github.com/Icinga/icinga2 / Stop

Method Stop

lib/base/timer.cpp:179–198  ·  view source on GitHub ↗

* Unregisters the timer and stops processing events for it. */

Source from the content-addressed store, hash-verified

177 * Unregisters the timer and stops processing events for it.
178 */
179void Timer::Stop(bool wait)
180{
181 if (l_StopTimerThread)
182 return;
183
184 std::unique_lock<std::mutex> lock(l_TimerMutex);
185
186 if (m_Started && --l_AliveTimers == 0) {
187 UninitializeThread();
188 }
189
190 m_Started = false;
191 l_Timers.erase(this);
192
193 /* Notify the worker thread that we've disabled a timer. */
194 l_TimerCV.notify_all();
195
196 while (wait && m_Running)
197 l_TimerCV.wait(lock);
198}
199
200void Timer::Reschedule(double next)
201{

Callers 1

~WorkQueueMethod · 0.45

Calls 1

eraseMethod · 0.45

Tested by

no test coverage detected