1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

super_node: move main loop into SuperNode::run()

This commit is contained in:
Steffen Vogel 2019-02-11 16:33:14 +01:00
parent d3f3c127d1
commit 836d8244d9
2 changed files with 9 additions and 10 deletions

View file

@ -488,12 +488,15 @@ void SuperNode::stop()
void SuperNode::run()
{
#ifdef WITH_HOOKS
task_wait(&task);
periodic();
#else
pause();
#endif /* WITH_HOOKS */
int ret;
while (state == STATE_STARTED) {
task_wait(&task);
ret = periodic();
if (ret)
state = STATE_STOPPING;
}
}
SuperNode::~SuperNode()

View file

@ -175,10 +175,6 @@ int main(int argc, char *argv[])
throw RuntimeError("Failed to verify configuration");
sn.start();
while (!stop)
sn.run();
sn.stop();
logger->info(CLR_GRN("Goodbye!"));