nicer walk_supers.

git-svn-id: file:///svn/unbound/trunk@480 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-08-02 12:22:29 +00:00
parent 6849c1030b
commit c70c747c04
2 changed files with 7 additions and 9 deletions

View file

@ -473,17 +473,15 @@ void mesh_query_done(struct mesh_state* mstate)
}
}
void mesh_walk_supers(struct module_qstate* qstate, int id)
void mesh_walk_supers(struct mesh_area* mesh, struct mesh_state* mstate)
{
struct mesh_state* m = qstate->mesh_info;
struct mesh_area* mesh = m->s.env->mesh;
struct mesh_state_ref* ref;
RBTREE_FOR(ref, struct mesh_state_ref*, &qstate->mesh_info->super_set)
RBTREE_FOR(ref, struct mesh_state_ref*, &mstate->super_set)
{
/* make super runnable */
(void)rbtree_insert(&mesh->run, &ref->s->run_node);
/* callback the function to inform super of result */
(*mesh->modfunc[ref->s->s.curmod]->inform_super)(qstate,
(*mesh->modfunc[ref->s->s.curmod]->inform_super)(&mstate->s,
ref->s->s.curmod, &ref->s->s);
}
}
@ -564,7 +562,7 @@ mesh_continue(struct mesh_area* mesh, struct mesh_state* mstate,
if(s == module_error || s == module_finished) {
if(mstate->s.curmod == 0) {
mesh_query_done(mstate);
mesh_walk_supers(&mstate->s, mstate->s.curmod);
mesh_walk_supers(mesh, mstate);
mesh_state_delete(&mstate->s);
return 0;
}

View file

@ -255,10 +255,10 @@ void mesh_query_done(struct mesh_state* mstate);
* Called when a module is module_finished or returns module_error.
* The super query states become runnable with event module_event_pass.
*
* @param qstate: the state that has results, used to find mesh state.
* @param id: module id.
* @param mesh: mesh area to add newly runnable modules to.
* @param mstate: the state that has results, used to find mesh state.
*/
void mesh_walk_supers(struct module_qstate* qstate, int id);
void mesh_walk_supers(struct mesh_area* mesh, struct mesh_state* mstate);
/**
* Delete mesh state, cleanup and also rbtrees and so on.