Move suspend on idle in module

Move suspend-on-idle code from the node to a module
Add some more SpaLoop API
This commit is contained in:
Wim Taymans 2016-11-21 12:54:40 +01:00
parent d250ed42e6
commit 3dcbf4b228
13 changed files with 363 additions and 110 deletions

View file

@ -96,11 +96,14 @@ do_loop (void *user_data)
make_realtime (this);
pinos_log_debug ("data-loop %p: enter thread", this);
pinos_loop_enter_thread (impl->this.loop);
while (impl->running) {
if ((res = pinos_loop_iterate (this->loop, -1)) < 0)
pinos_log_warn ("data-loop %p: iterate error %d", this, res);
}
pinos_log_debug ("data-loop %p: leave thread", this);
pinos_loop_leave_thread (impl->this.loop);
return NULL;
}
@ -169,7 +172,6 @@ pinos_data_loop_start (PinosDataLoop *loop)
impl->running = false;
return SPA_RESULT_ERROR;
}
pinos_loop_set_thread (impl->this.loop, &impl->thread);
}
return SPA_RESULT_OK;
}