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;
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);
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;
}