make the threadpool a local

master
Daniel Kolesa 2016-08-02 19:56:34 +01:00
parent 5bd9f470f4
commit 113d18c026
1 changed files with 2 additions and 3 deletions

View File

@ -210,8 +210,6 @@ static ConstCharRange ob_compare_subst(
return expanded;
}
static ThreadPool tpool;
struct ObState: CsState {
ConstCharRange progname;
int jobs = 1;
@ -574,11 +572,12 @@ int main(int argc, char **argv) {
}
}
ThreadPool tpool;
tpool.init(os.jobs);
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();
cnt->incr();
tpool.push([cnt, ds = String(args[0].get_strr())]() {