CONCPP-134: Remove use of volatile in ServerPrepareResult::shareCounter and others

This commit is contained in:
Zach Toogood
2024-11-01 09:16:32 +00:00
committed by lawrinn
parent 366414f29b
commit 2c636f4be0
4 changed files with 8 additions and 6 deletions

View File

@ -21,6 +21,7 @@
#ifndef _MARIADBCONNECTION_H_
#define _MARIADBCONNECTION_H_
#include <atomic>
#include <mutex>
#include "MariaDbStatement.h"
@ -74,7 +75,7 @@ public:
bool nullCatalogMeansCurrent;
private:
std::unique_ptr<CallableStatementCache> callableStatementCache;
volatile int32_t lowercaseTableNames= -1;
std::atomic<int32_t> lowercaseTableNames{-1};
bool _canUseServerTimeout;
bool sessionStateAware;
int32_t stateFlag= 0 ;

View File

@ -21,6 +21,7 @@
#ifndef _MARIADBSTATEMENT_H_
#define _MARIADBSTATEMENT_H_
#include <atomic>
#include <map>
#include <mutex>
@ -57,12 +58,12 @@ protected:
bool canUseServerTimeout;
Shared::ExceptionFactory exceptionFactory;
volatile bool closed= false;
std::atomic<bool> closed{false};
int32_t queryTimeout= 0;
int64_t maxRows= 0;
Shared::Results results;
int32_t fetchSize;
volatile bool executing= false;
std::atomic<bool> executing{false};
sql::Ints batchRes;
sql::Longs largeBatchRes;

View File

@ -79,7 +79,7 @@ namespace capi
bool readOnly= false;
FailoverProxy* proxy= nullptr;
volatile bool connected= false;
std::atomic<bool> connected{false};
bool explicitClosed= false;
SQLString database;
int64_t serverThreadId= 0;

View File

@ -51,8 +51,8 @@ class ServerPrepareResult : public PrepareResult {
std::unique_ptr<capi::MYSQL_RES, decltype(&capi::mysql_free_result)> metadata;
std::vector<capi::MYSQL_BIND> paramBind;
Protocol* unProxiedProtocol;
volatile int32_t shareCounter= 1;
volatile bool isBeingDeallocate= false;
std::atomic<int32_t> shareCounter{1};
std::atomic<bool> isBeingDeallocate{false};
std::mutex lock;
public: