feat(Core/Threading): replace ace threading (#4821)
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include "QueryHolder.h"
|
||||
#include "AdhocStatement.h"
|
||||
#include "StringFormat.h"
|
||||
#include <ace/Thread_Mutex.h>
|
||||
#include <mutex>
|
||||
|
||||
class PingOperation : public SQLOperation
|
||||
{
|
||||
|
||||
@@ -90,13 +90,13 @@ protected:
|
||||
{
|
||||
/// Tries to acquire lock. If lock is acquired by another thread
|
||||
/// the calling parent will just try another connection
|
||||
return m_Mutex.tryacquire() != -1;
|
||||
return m_Mutex.try_lock();
|
||||
}
|
||||
|
||||
void Unlock()
|
||||
{
|
||||
/// Called by parent databasepool. Will let other threads access this connection
|
||||
m_Mutex.release();
|
||||
m_Mutex.unlock();
|
||||
}
|
||||
|
||||
MYSQL* GetHandle() { return m_Mysql; }
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
MYSQL* m_Mysql; //! MySQL Handle.
|
||||
MySQLConnectionInfo& m_connectionInfo; //! Connection info (used for logging)
|
||||
ConnectionFlags m_connectionFlags; //! Connection flags (for preparing relevant statements)
|
||||
ACE_Thread_Mutex m_Mutex;
|
||||
std::mutex m_Mutex;
|
||||
|
||||
MySQLConnection(MySQLConnection const& right) = delete;
|
||||
MySQLConnection& operator=(MySQLConnection const& right) = delete;
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
#ifndef QUERYRESULT_H
|
||||
#define QUERYRESULT_H
|
||||
|
||||
#include <ace/Thread_Mutex.h>
|
||||
|
||||
#include "Errors.h"
|
||||
#include "Field.h"
|
||||
#include <mutex>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
|
||||
Reference in New Issue
Block a user