3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-11 13:40:52 +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

@ -16,10 +16,8 @@ Author:
Revision History:
--*/
#ifndef RLIMIT_H_
#define RLIMIT_H_
#pragma once
#include <mutex>
#include "util/vector.h"
class reslimit {
@ -29,14 +27,12 @@ class reslimit {
uint64_t m_limit;
svector<uint64_t> m_limits;
ptr_vector<reslimit> m_children;
std::mutex m_mux;
void set_cancel(unsigned f);
friend class scoped_suspend_rlimit;
public:
reslimit();
~reslimit() {}
void push(unsigned delta_limit);
void pop();
void push_child(reslimit* r);
@ -91,6 +87,3 @@ struct scoped_limits {
~scoped_limits() { for (unsigned i = 0; i < m_sz; ++i) m_limit.pop_child(); }
void push_child(reslimit* lim) { m_limit.push_child(lim); ++m_sz; }
};
#endif