From c70c747c04171bcd568de40b9324d3e59284f7b7 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 2 Aug 2007 12:22:29 +0000 Subject: [PATCH] nicer walk_supers. git-svn-id: file:///svn/unbound/trunk@480 be551aaa-1e26-0410-a405-d3ace91eadb9 --- services/mesh.c | 10 ++++------ services/mesh.h | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/services/mesh.c b/services/mesh.c index 7ec5a82b2..308f1d38f 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -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; } diff --git a/services/mesh.h b/services/mesh.h index a5a048fea..f0818e26d 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -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. -- 2.47.2