3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-10 17:58:06 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-06-03 20:20:36 -07:00 committed by Nuno Lopes
parent 9262908ebb
commit 59330b3855
5 changed files with 23 additions and 15 deletions

View file

@ -1243,8 +1243,7 @@ namespace sat {
unsigned error_code = 0;
lbool result = l_undef;
bool canceled = false;
#pragma omp parallel for
for (int i = 0; i < num_threads; ++i) {
auto worker_thread = [&](int i) {
try {
lbool r = l_undef;
if (IS_AUX_SOLVER(i)) {
@ -1296,6 +1295,14 @@ namespace sat {
ex_msg = ex.msg();
ex_kind = DEFAULT_EX;
}
};
vector<std::thread> threads;
for (int i = 0; i < num_threads; ++i) {
threads.push_back(std::thread([&]() { worker_thread(i); }));
}
for (int i = 0; i < num_threads; ++i) {
threads[i].join();
}
if (IS_AUX_SOLVER(finished_id)) {