aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.h
diff options
context:
space:
mode:
authorleak <leak@bitmx.net>2014-07-01 00:54:09 +0200
committerleak <leak@bitmx.net>2014-07-01 00:54:09 +0200
commit029bad6698df6ac9556fe308342e616f4a7a8cc7 (patch)
tree01142dad7e748aba7799b9c296ccc4cf11db886f /src/server/shared/Database/MySQLConnection.h
parentd39a013b6b979a5158bf86c37a197cb902b2c2f9 (diff)
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)
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.h')
-rw-r--r--src/server/shared/Database/MySQLConnection.h8
1 files changed, 3 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>.
*/
-#include <ace/Activation_Queue.h>
-
#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;