aboutsummaryrefslogtreecommitdiff
path: root/src/threader_single.c
blob: 232835d976340f25f7670b1ce46953685434e022 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "threader_single.h"

static void             append_sol(Alg *, void *);
static void             dispatch(DfsArg *, AlgList *, Solver *, Threader *);
static int              get_nsol(void *);

Threader threader_single = {
	.append_sol      = append_sol,
	.dispatch        = dispatch,
	.get_nsol        = get_nsol,
};

static void
append_sol(Alg *alg, void *threaddata)
{
	append_alg((AlgList *)threaddata, alg);
}

static void
dispatch(DfsArg *arg, AlgList *sols, Solver *solver, Threader *threader)
{
	arg->threaddata  = sols;
	arg->niss        = false;
	arg->current_alg = new_alg("");

	dfs(arg, solver, threader);

	free_alg(arg->current_alg);
}

static int
get_nsol(void *threaddata)
{
	return ((AlgList *)threaddata)->len;
}

Generated with cgit - Back to sebastiano.tronto.net