write_common: get rid of POST_ADD_TAIL
authorAndre <maan@p133.(none)>
Sun, 4 Jun 2006 23:32:34 +0000 (01:32 +0200)
committerAndre <maan@p133.(none)>
Sun, 4 Jun 2006 23:32:34 +0000 (01:32 +0200)
just register the tasks the other way round.

write_common.c

index a413d47..a28a105 100644 (file)
@@ -61,6 +61,7 @@ int wng_open(struct writer_node_group *g)
        int i, ret = 1;
 
        PARA_NOTICE_LOG("opening wng %p with %d writer(s)\n", g, g->num_writers);
+       register_task(&g->task);
        FOR_EACH_WRITER_NODE(i, g) {
                struct writer_node *wn = &g->writer_nodes[i];
                wn->wng = g;
@@ -75,10 +76,10 @@ int wng_open(struct writer_node_group *g)
                register_task(&wn->task);
        }
        sprintf(g->task.status, "%s", "writer node group");
-       register_task(&g->task);
        g->eof = 0;
        return 1;
 err_out:
+       unregister_task(&g->task);
        while (i > 0) {
                struct writer_node *wn = &g->writer_nodes[--i];
                unregister_task(&wn->task);
@@ -126,7 +127,7 @@ struct writer_node_group *wng_new(unsigned num_writers)
        g->written = para_calloc(num_writers * sizeof(size_t));
        g->task.private_data = g;
        g->task.post_select = wng_post_select;
-       g->task.flags = POST_ADD_TAIL;
+       g->task.flags = 0;
        return g;
 }