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:
parent
d3f3c127d1
commit
836d8244d9
2 changed files with 9 additions and 10 deletions
|
@ -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()
|
||||
|
|
|
@ -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!"));
|
||||
|
|
Loading…
Add table
Reference in a new issue