mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
capture i by value
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
27971e3f68
commit
7f74382863
4 changed files with 36 additions and 38 deletions
|
@ -20,6 +20,8 @@ Revision History:
|
|||
#include "util/common_msgs.h"
|
||||
|
||||
|
||||
static std::mutex g_rlimit_mux;
|
||||
|
||||
reslimit::reslimit():
|
||||
m_cancel(0),
|
||||
m_suspend(false),
|
||||
|
@ -70,34 +72,34 @@ char const* reslimit::get_cancel_msg() const {
|
|||
}
|
||||
|
||||
void reslimit::push_child(reslimit* r) {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
m_children.push_back(r);
|
||||
}
|
||||
|
||||
void reslimit::pop_child() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
m_children.pop_back();
|
||||
}
|
||||
|
||||
void reslimit::cancel() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
set_cancel(m_cancel+1);
|
||||
}
|
||||
|
||||
|
||||
void reslimit::reset_cancel() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
set_cancel(0);
|
||||
}
|
||||
|
||||
void reslimit::inc_cancel() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
set_cancel(m_cancel+1);
|
||||
}
|
||||
|
||||
|
||||
void reslimit::dec_cancel() {
|
||||
std::lock_guard<std::mutex> lock(m_mux);
|
||||
std::lock_guard<std::mutex> lock(g_rlimit_mux);
|
||||
if (m_cancel > 0) {
|
||||
set_cancel(m_cancel-1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue