rt-poll: make small poll helper object

Remove the event loop code into a separate object so that we can share
the same loop for multiple nodes.
Some cleanups
This commit is contained in:
Wim Taymans 2016-09-26 17:27:04 +02:00
parent b9409e297b
commit 7b53fa8685
11 changed files with 517 additions and 239 deletions

View file

@ -31,6 +31,7 @@
#include "pinos/server/client-node.h"
#include "pinos/server/client.h"
#include "pinos/server/link.h"
#include "pinos/server/rt-loop.h"
#include "pinos/dbus/org-pinos.h"
@ -47,6 +48,7 @@ struct _PinosDaemonPrivate
GList *nodes;
GHashTable *clients;
PinosRTLoop *loop;
PinosProperties *properties;
@ -326,9 +328,12 @@ static void
on_node_added (PinosDaemon *daemon, PinosNode *node)
{
PinosNodeState state;
PinosDaemonPrivate *priv = daemon->priv;
g_debug ("daemon %p: node %p added", daemon, node);
g_object_set (node, "rt-loop", priv->loop, NULL);
g_signal_connect (node, "state-change", (GCallback) on_node_state_change, daemon);
state = pinos_node_get_state (node);
@ -763,6 +768,7 @@ pinos_daemon_finalize (GObject * object)
g_debug ("daemon %p: finalize", object);
g_clear_object (&priv->server_manager);
g_clear_object (&priv->iface);
g_clear_object (&priv->loop);
g_hash_table_unref (priv->clients);
g_hash_table_unref (priv->node_factories);
@ -820,6 +826,7 @@ pinos_daemon_init (PinosDaemon * daemon)
g_str_equal,
g_free,
g_object_unref);
priv->loop = pinos_rtloop_new();
}
/**