From 029bad6698df6ac9556fe308342e616f4a7a8cc7 Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 1 Jul 2014 00:54:09 +0200 Subject: Replaced all remaining ACE based Singletons Replaced ACE base AutoPtr class with shared_ptr Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be) --- src/server/shared/Database/MySQLConnection.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/server/shared/Database/MySQLConnection.h') diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h index 3b7efeb5846..61b3b37cbc2 100644 --- a/src/server/shared/Database/MySQLConnection.h +++ b/src/server/shared/Database/MySQLConnection.h @@ -15,8 +15,6 @@ * with this program. If not, see . */ -#include - #include "DatabaseWorkerPool.h" #include "Transaction.h" #include "Util.h" @@ -100,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; } @@ -131,7 +129,7 @@ class MySQLConnection 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; -- cgit v1.2.3