mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 01:41:23 +02:00
neutrino: wait for timerd to avoid race on startup
This commit is contained in:
@@ -469,12 +469,16 @@ int timerd_main_thread(void *data)
|
||||
|
||||
CBasicServer timerd_server;
|
||||
|
||||
if (!timerd_server.prepare(TIMERD_UDS_NAME))
|
||||
if (!timerd_server.prepare(TIMERD_UDS_NAME)) {
|
||||
*(long *)data = -2; /* signal neutrino that waiting is pointless */
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Start timer thread
|
||||
CTimerManager::getInstance();
|
||||
CTimerManager::getInstance()->wakeup =(bool)data;
|
||||
CTimerManager::getInstance()->wakeup = !!(*(long *)data);
|
||||
|
||||
*(long *)data = -1; /* signal we're up and running */
|
||||
|
||||
timerd_server.run(timerd_parse_command, CTimerdMsg::ACTVERSION);
|
||||
printf("timerd shutdown complete\n");
|
||||
|
Reference in New Issue
Block a user