forked from OctaForge/OctaBuild
make the threadpool a local
parent
5bd9f470f4
commit
113d18c026
5
main.cc
5
main.cc
|
@ -210,8 +210,6 @@ static ConstCharRange ob_compare_subst(
|
||||||
return expanded;
|
return expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ThreadPool tpool;
|
|
||||||
|
|
||||||
struct ObState: CsState {
|
struct ObState: CsState {
|
||||||
ConstCharRange progname;
|
ConstCharRange progname;
|
||||||
int jobs = 1;
|
int jobs = 1;
|
||||||
|
@ -574,11 +572,12 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThreadPool tpool;
|
||||||
tpool.init(os.jobs);
|
tpool.init(os.jobs);
|
||||||
|
|
||||||
os.register_rulecmds();
|
os.register_rulecmds();
|
||||||
|
|
||||||
os.add_command("shell", "C", [&os](TvalRange args) {
|
os.add_command("shell", "C", [&os, &tpool](TvalRange args) {
|
||||||
auto cnt = os.counters.back();
|
auto cnt = os.counters.back();
|
||||||
cnt->incr();
|
cnt->incr();
|
||||||
tpool.push([cnt, ds = String(args[0].get_strr())]() {
|
tpool.push([cnt, ds = String(args[0].get_strr())]() {
|
||||||
|
|
Loading…
Reference in New Issue