Skip to content

Commit

Permalink
extra debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
petiaccja committed Feb 20, 2024
1 parent 0e5353b commit 0b0702a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/testing/interleaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ std::vector<thread_state> stabilize(std::span<std::unique_ptr<thread>> threads)
do {
const auto elapsed = std::chrono::high_resolution_clock::now() - start;
if (elapsed > 200ms) {
throw std::logic_error("deadlock");
throw std::logic_error("deadlock - still running");
}
states = get_states(threads);
} while (!is_stable(states));

while (!is_unblocked(states)) {
const auto elapsed = std::chrono::high_resolution_clock::now() - start;
if (elapsed > 200ms) {
throw std::logic_error("deadlock");
throw std::logic_error("deadlock - all blocked");
}
states = get_states(threads);
}
Expand Down Expand Up @@ -307,6 +307,8 @@ path run_next_interleaving(tree& tree, std::span<std::unique_ptr<thread>> swarm)
current_node = &tree.next(transition_node, resumed);
}
catch (std::exception&) {
const auto locked_states = get_states(swarm);
path.steps.push_back({ swarm_state(locked_states), -1 });
std::cerr << path.dump() << std::endl;
std::terminate();
}
Expand Down

0 comments on commit 0b0702a

Please sign in to comment.