aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.h')
-rw-r--r--src/server/shared/Database/MySQLConnection.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index 512df7c16c7..61b3b37cbc2 100644
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -15,11 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <ace/Activation_Queue.h>
-
#include "DatabaseWorkerPool.h"
#include "Transaction.h"
#include "Util.h"
+#include "ProducerConsumerQueue.h"
#ifndef _MYSQLCONNECTION_H
#define _MYSQLCONNECTION_H
@@ -70,7 +69,7 @@ class MySQLConnection
public:
MySQLConnection(MySQLConnectionInfo& connInfo); //! Constructor for synchronous connections.
- MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInfo& connInfo); //! Constructor for asynchronous connections.
+ MySQLConnection(ProducerConsumerQueue<SQLOperation*>* queue, MySQLConnectionInfo& connInfo); //! Constructor for asynchronous connections.
virtual ~MySQLConnection();
virtual bool Open();
@@ -99,13 +98,13 @@ class MySQLConnection
{
/// 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; }
@@ -125,12 +124,12 @@ class MySQLConnection
bool _HandleMySQLErrno(uint32 errNo);
private:
- ACE_Activation_Queue* m_queue; //! Queue shared with other asynchronous connections.
+ ProducerConsumerQueue<SQLOperation*>* m_queue; //! Queue shared with other asynchronous connections.
DatabaseWorker* m_worker; //! Core worker task.
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;