diff options
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/worker.c b/src/worker.c index 9fec49b..6cfa1bb 100644 --- a/src/worker.c +++ b/src/worker.c @@ -86,7 +86,21 @@ int worker_init( worker_t *worker ) return -1; } + GMainContext *context = g_main_context_default( ); + GMainLoop *main_loop = g_main_loop_new( context, TRUE ); + g_child_watch_add( wed->pid, (GChildWatchFunc)watch_child, (gpointer *)wed ); + + // TODO: first one blocks (of course).. + //~ g_main_loop_run( main_loop ); + + // .. second one should go into the coordinator loop + // (and should not leak the glib-based implementation + // to the coordinator) + //~ for( ;; ) { + //~ gboolean res = g_main_context_iteration( context, FALSE ); + //~ sleep( 1 ); + //~ } worker->state = WORKER_STATE_RUNNING; |