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

turn locks into no-ops when compiled with -DSINGLE_THREAD

This commit is contained in:
Nuno Lopes 2019-06-05 12:11:27 +01:00
parent 9b375150eb
commit a53ff6f21c
17 changed files with 106 additions and 79 deletions

View file

@ -17,13 +17,13 @@ Revision History:
--*/
#include "util/symbol.h"
#include "util/mutex.h"
#include "util/str_hashtable.h"
#include "util/region.h"
#include "util/string_buffer.h"
#include <cstring>
#include <mutex>
static std::mutex g_symbol_lock;
static 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;
std::lock_guard<std::mutex> 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