mirror of
https://github.com/mariadb-corporation/mariadb-connector-cpp.git
synced 2025-07-22 18:27:20 +00:00
CONCPP-134: Remove use of volatile in ServerPrepareResult::shareCounter and others
This commit is contained in:
@ -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 ;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user