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

remove remaining _NO_OMP_

This commit is contained in:
Nuno Lopes 2019-06-05 10:07:16 +01:00
parent 37882f5afa
commit 9b375150eb
11 changed files with 39 additions and 71 deletions

View file

@ -17,15 +17,16 @@ Revision History:
--*/
#ifdef _WINDOWS
#include <windows.h>
#endif
#include <thread>
#include "util/util.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(); }
#endif
static unsigned g_verbosity_level = 0;
@ -43,23 +44,13 @@ void set_verbose_stream(std::ostream& str) {
g_verbose_stream = &str;
}
#ifndef _NO_OMP_
#ifdef _WINDOWS
static int g_thread_id = 0;
#else
#ifndef SINGLE_THREAD
static std::thread::id g_thread_id = std::this_thread::get_id();
#endif
static bool g_is_threaded = false;
bool is_threaded() {
if (g_is_threaded) return true;
#ifdef _WINDOWS
int thid = GetCurrentThreadId();
g_is_threaded = g_thread_id != thid && g_thread_id != 0;
g_thread_id = thid;
#else
g_is_threaded = std::this_thread::get_id() != g_thread_id;
#endif
return g_is_threaded;
}
#endif