mirror of https://github.com/Icinga/icinga2.git
Timer::TimerThreadProc(): don't unnecessarily unlock and lock l_TimerMutex
This commit is contained in:
parent
1badbab002
commit
13b9cfda41
|
@ -292,9 +292,9 @@ void Timer::TimerThreadProc()
|
||||||
|
|
||||||
Utility::SetThreadName("Timer Thread");
|
Utility::SetThreadName("Timer Thread");
|
||||||
|
|
||||||
for (;;) {
|
std::unique_lock<std::mutex> lock (l_TimerMutex);
|
||||||
std::unique_lock<std::mutex> lock(l_TimerMutex);
|
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
typedef boost::multi_index::nth_index<TimerSet, 1>::type NextTimerView;
|
typedef boost::multi_index::nth_index<TimerSet, 1>::type NextTimerView;
|
||||||
NextTimerView& idx = boost::get<1>(l_Timers);
|
NextTimerView& idx = boost::get<1>(l_Timers);
|
||||||
|
|
||||||
|
@ -339,5 +339,7 @@ void Timer::TimerThreadProc()
|
||||||
|
|
||||||
/* Asynchronously call the timer. */
|
/* Asynchronously call the timer. */
|
||||||
Utility::QueueAsyncCallback([timer=std::move(keepAlive)]() { timer->Call(); });
|
Utility::QueueAsyncCallback([timer=std::move(keepAlive)]() { timer->Call(); });
|
||||||
|
|
||||||
|
lock.lock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue