Skip to content

Commit bcbfeec

Browse files
address deadlock in cancellation path
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
1 parent 864c6a3 commit bcbfeec

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/solver/parallel_tactical2.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ class parallel_solver {
480480
cancel_workers_unlocked();
481481
}
482482

483+
void set_cancel() {
484+
std::scoped_lock lock(mux);
485+
cancel_workers_unlocked();
486+
}
487+
483488
void set_unsat(ast_translation& l2g,
484489
expr_ref_vector const& core) {
485490
std::scoped_lock lock(mux);
@@ -1130,8 +1135,10 @@ class parallel_solver {
11301135
if (m_config.m_global_backbones) {
11311136
bb_candidates local_candidates = find_backbone_candidates(cube);
11321137
b.collect_backbone_candidates(m_l2g, local_candidates);
1133-
if (!m.inc())
1138+
if (!m.inc()) {
1139+
b.set_cancel();
11341140
return;
1141+
}
11351142
}
11361143
lbool r = check_cube(cube);
11371144

@@ -1142,7 +1149,10 @@ class parallel_solver {
11421149
continue;
11431150
}
11441151

1145-
if (!m.inc()) return;
1152+
if (!m.inc()) {
1153+
b.set_cancel();
1154+
return;
1155+
}
11461156

11471157
switch (r) {
11481158

0 commit comments

Comments
 (0)