3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

capture i by value

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-06-04 12:42:35 -07:00 committed by Nuno Lopes
parent 27971e3f68
commit 7f74382863
4 changed files with 36 additions and 38 deletions

View file

@ -1300,13 +1300,12 @@ namespace sat {
}
};
vector<std::thread> threads;
vector<std::thread> threads(num_threads);
for (int i = 0; i < num_threads; ++i) {
int id = i;
threads.push_back(std::thread([&]() { worker_thread(id); }));
threads[i] = std::thread([&, i]() { worker_thread(i); });
}
for (int i = 0; i < num_threads; ++i) {
threads[i].join();
for (auto & th : threads) {
th.join();
}
if (IS_AUX_SOLVER(finished_id)) {