3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

support threading for TRACE mode

This commit is contained in:
Nikolaj Bjorner 2021-10-25 13:35:23 +02:00
parent 4b7c08d08d
commit 3036b88f09
7 changed files with 64 additions and 55 deletions

View file

@ -19,6 +19,25 @@ Revision History:
#include "util/trace.h"
#include "util/str_hashtable.h"
#ifndef SINGLE_THREAD
#include <mutex>
#include <thread>
static std::mutex g_verbose_mux;
void verbose_lock() { g_verbose_mux.lock(); }
void verbose_unlock() { g_verbose_mux.unlock(); }
static std::thread::id g_thread_id = std::this_thread::get_id();
static bool g_is_threaded = false;
bool is_threaded() {
if (g_is_threaded) return true;
g_is_threaded = std::this_thread::get_id() != g_thread_id;
return g_is_threaded;
}
#endif
#ifdef _TRACE
std::ofstream tout(".z3-trace");