mirror of
https://github.com/Z3Prover/z3
synced 2025-06-23 06:13:40 +00:00
addressing race condition on interrupts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c0895e5548
commit
ec121db5c1
1 changed files with 21 additions and 8 deletions
|
@ -54,13 +54,19 @@ static void display_statistics() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_timeout() {
|
static void on_timeout() {
|
||||||
|
#pragma omp critical (g_display_stats)
|
||||||
|
{
|
||||||
display_statistics();
|
display_statistics();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_ctrl_c(int) {
|
static void on_ctrl_c(int) {
|
||||||
signal (SIGINT, SIG_DFL);
|
signal (SIGINT, SIG_DFL);
|
||||||
|
#pragma omp critical (g_display_stats)
|
||||||
|
{
|
||||||
display_statistics();
|
display_statistics();
|
||||||
|
}
|
||||||
raise(SIGINT);
|
raise(SIGINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,9 +89,12 @@ unsigned read_smtlib_file(char const * benchmark_file) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma omp critical (g_display_stats)
|
||||||
|
{
|
||||||
display_statistics();
|
display_statistics();
|
||||||
register_on_timeout_proc(0);
|
register_on_timeout_proc(0);
|
||||||
g_solver = 0;
|
g_solver = 0;
|
||||||
|
}
|
||||||
return solver.get_error_code();
|
return solver.get_error_code();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,8 +127,12 @@ unsigned read_smtlib2_commands(char const * file_name) {
|
||||||
result = parse_smt2_commands(ctx, std::cin, true);
|
result = parse_smt2_commands(ctx, std::cin, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma omp critical (g_display_stats)
|
||||||
|
{
|
||||||
display_statistics();
|
display_statistics();
|
||||||
g_cmd_context = 0;
|
g_cmd_context = 0;
|
||||||
|
}
|
||||||
return result ? 0 : 1;
|
return result ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue