threader_single.c (739B)
1 #include "threader_single.h" 2 3 static void append_sol(Alg *, void *); 4 static void dispatch(DfsArg *, AlgList *, Solver *, Threader *); 5 static int get_nsol(void *); 6 7 Threader threader_single = { 8 .append_sol = append_sol, 9 .dispatch = dispatch, 10 .get_nsol = get_nsol, 11 }; 12 13 static void 14 append_sol(Alg *alg, void *threaddata) 15 { 16 append_alg((AlgList *)threaddata, alg); 17 } 18 19 static void 20 dispatch(DfsArg *arg, AlgList *sols, Solver *solver, Threader *threader) 21 { 22 arg->threaddata = sols; 23 arg->niss = false; 24 arg->current_alg = new_alg(""); 25 26 dfs(arg, solver, threader); 27 28 free_alg(arg->current_alg); 29 } 30 31 static int 32 get_nsol(void *threaddata) 33 { 34 return ((AlgList *)threaddata)->len; 35 }