mirror of
https://github.com/Z3Prover/z3
synced 2025-06-28 08:58:44 +00:00
fix crash on Mac due to different destruction order of globals
the mutex in memory_manager has to be destroyed after all mem deallocations happen
This commit is contained in:
parent
2bee9a062f
commit
cf3e649462
12 changed files with 80 additions and 120 deletions
|
@ -21,8 +21,6 @@ Revision History:
|
|||
#include<iostream>
|
||||
#include<time.h>
|
||||
#include<signal.h>
|
||||
#include<mutex>
|
||||
|
||||
#include "util/timeout.h"
|
||||
#include "parsers/smt2/smt2parser.h"
|
||||
#include "muz/fp/dl_cmds.h"
|
||||
|
@ -34,7 +32,8 @@ Revision History:
|
|||
#include "tactic/portfolio/smt_strategic_solver.h"
|
||||
#include "smt/smt_solver.h"
|
||||
|
||||
extern std::mutex* g_stat_mux;
|
||||
static std::mutex display_stats_mux;
|
||||
|
||||
extern bool g_display_statistics;
|
||||
static clock_t g_start_time;
|
||||
static cmd_context * g_cmd_context = nullptr;
|
||||
|
@ -52,7 +51,7 @@ static void display_statistics() {
|
|||
}
|
||||
|
||||
static void on_timeout() {
|
||||
std::lock_guard<std::mutex> lock(*g_stat_mux);
|
||||
std::lock_guard<std::mutex> lock(display_stats_mux);
|
||||
display_statistics();
|
||||
exit(0);
|
||||
}
|
||||
|
@ -60,7 +59,7 @@ static void on_timeout() {
|
|||
static void STD_CALL on_ctrl_c(int) {
|
||||
signal (SIGINT, SIG_DFL);
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(*g_stat_mux);
|
||||
std::lock_guard<std::mutex> lock(display_stats_mux);
|
||||
display_statistics();
|
||||
}
|
||||
raise(SIGINT);
|
||||
|
@ -100,7 +99,7 @@ unsigned read_smtlib2_commands(char const * file_name) {
|
|||
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(*g_stat_mux);
|
||||
std::lock_guard<std::mutex> lock(display_stats_mux);
|
||||
display_statistics();
|
||||
g_cmd_context = nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue