Add debug logging for daemonize/timers

The previous commit is 1:1 the same I've implemented
here already. Great teamwork with Alex :)

refs #6445
This commit is contained in:
Michael Friedrich 2018-07-19 13:34:12 +02:00
parent d15e1006f3
commit 7519d23892
3 changed files with 8 additions and 2 deletions

View File

@ -138,9 +138,10 @@ void Application::InitializeBase()
Loader::ExecuteDeferredInitializers();
/* make sure the thread pool gets initialized */
/* Make sure the thread pool gets initialized. */
GetTP().Start();
/* Make sure the timer thread gets initialized. */
Timer::Initialize();
}
@ -302,7 +303,6 @@ void Application::SetArgV(char **argv)
*/
void Application::RunEventLoop()
{
#ifdef HAVE_SYSTEMD
sd_notify(0, "READY=1");
#endif /* HAVE_SYSTEMD */

View File

@ -19,6 +19,7 @@
#include "base/timer.hpp"
#include "base/debug.hpp"
#include "base/logger.hpp"
#include "base/utility.hpp"
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
@ -259,6 +260,8 @@ void Timer::AdjustTimers(double adjustment)
*/
void Timer::TimerThreadProc()
{
Log(LogDebug, "Timer", "TimerThreadProc started.");
Utility::SetThreadName("Timer Thread");
for (;;) {

View File

@ -88,6 +88,9 @@ static bool Daemonize()
_exit(EXIT_SUCCESS);
}
Log(LogDebug, "Daemonize()")
<< "Child process with PID " << Utility::GetPid() << " continues; re-initializing base.";
Application::InitializeBase();
#endif /* _WIN32 */