mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
turn locks into no-ops when compiled with -DSINGLE_THREAD
This commit is contained in:
parent
9b375150eb
commit
a53ff6f21c
17 changed files with 106 additions and 79 deletions
|
@ -119,18 +119,18 @@ namespace api {
|
|||
|
||||
context::set_interruptable::set_interruptable(context & ctx, event_handler & i):
|
||||
m_ctx(ctx) {
|
||||
std::lock_guard<std::mutex> lock(ctx.m_mux);
|
||||
lock_guard lock(ctx.m_mux);
|
||||
SASSERT(m_ctx.m_interruptable == 0);
|
||||
m_ctx.m_interruptable = &i;
|
||||
}
|
||||
|
||||
context::set_interruptable::~set_interruptable() {
|
||||
std::lock_guard<std::mutex> lock(m_ctx.m_mux);
|
||||
lock_guard lock(m_ctx.m_mux);
|
||||
m_ctx.m_interruptable = nullptr;
|
||||
}
|
||||
|
||||
void context::interrupt() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
lock_guard lock(m_mux);
|
||||
if (m_interruptable)
|
||||
(*m_interruptable)(API_INTERRUPT_EH_CALLER);
|
||||
m_limit.cancel();
|
||||
|
|
|
@ -42,7 +42,7 @@ Revision History:
|
|||
#include "ast/rewriter/seq_rewriter.h"
|
||||
#include "smt/smt_solver.h"
|
||||
#include "solver/solver.h"
|
||||
#include <mutex>
|
||||
#include "util/mutex.h"
|
||||
|
||||
namespace smtlib {
|
||||
class parser;
|
||||
|
@ -80,7 +80,7 @@ namespace api {
|
|||
scoped_ptr<ast_manager> m_manager;
|
||||
scoped_ptr<cmd_context> m_cmd;
|
||||
add_plugins m_plugins;
|
||||
std::mutex m_mux;
|
||||
mutex m_mux;
|
||||
|
||||
arith_util m_arith_util;
|
||||
bv_util m_bv_util;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue