3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-19 12:23:38 +00:00

restore most global muxes as heap-allocated to avoid crashes with hard-kills like ctrl-c

This commit is contained in:
Nuno Lopes 2019-06-13 18:42:57 +01:00
parent d17248821a
commit c21f0c2f00
8 changed files with 55 additions and 49 deletions

View file

@ -23,7 +23,7 @@ Revision History:
#include "util/string_buffer.h"
#include <cstring>
static mutex g_symbol_lock;
static DECLARE_MUTEX(g_symbol_lock);
symbol symbol::m_dummy(TAG(void*, nullptr, 2));
const symbol symbol::null;
@ -38,7 +38,7 @@ public:
char const * get_str(char const * d) {
const char * result;
lock_guard lock(g_symbol_lock);
lock_guard lock(*g_symbol_lock);
str_hashtable::entry * e;
if (m_table.insert_if_not_there_core(d, e)) {
// new entry
@ -69,6 +69,7 @@ void initialize_symbols() {
}
void finalize_symbols() {
delete g_symbol_lock;
dealloc(g_symbol_table);
g_symbol_table = nullptr;
}