3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-18 11:58:31 +00:00

replace remaining volatiles with atomic<>

volatiles are now deprecated in recent C++
This commit is contained in:
Nuno Lopes 2020-10-24 11:47:45 +01:00
parent a4aa87b6c9
commit 0213af3c61
7 changed files with 19 additions and 11 deletions

View file

@ -23,6 +23,7 @@ Notes:
#include "ast/ast_pp.h"
#include "solver/solver.h"
#include "solver/combined_solver_params.hpp"
#include <atomic>
#define PS_VB_LVL 15
/**
@ -71,7 +72,7 @@ private:
struct aux_timeout_eh : public event_handler {
solver * m_solver;
volatile bool m_canceled;
std::atomic<bool> m_canceled;
aux_timeout_eh(solver * s):m_solver(s), m_canceled(false) {}
~aux_timeout_eh() override {
if (m_canceled) {

View file

@ -47,6 +47,7 @@ tactic * mk_parallel_tactic(solver* s, params_ref const& p) {
#else
#include <atomic>
#include <thread>
#include <mutex>
#include <cmath>
@ -63,7 +64,7 @@ class parallel_tactic : public tactic {
ptr_vector<solver_state> m_tasks;
ptr_vector<solver_state> m_active;
unsigned m_num_waiters;
volatile bool m_shutdown;
std::atomic<bool> m_shutdown;
void inc_wait() {
std::lock_guard<std::mutex> lock(m_mutex);
@ -365,7 +366,7 @@ private:
unsigned m_branches;
unsigned m_backtrack_frequency;
unsigned m_conquer_delay;
volatile bool m_has_undef;
std::atomic<bool> m_has_undef;
bool m_allsat;
unsigned m_num_unsat;
unsigned m_last_depth;