diff options
Diffstat (limited to 'src/server/database/Database/MySQLConnection.h')
-rw-r--r-- | src/server/database/Database/MySQLConnection.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/server/database/Database/MySQLConnection.h b/src/server/database/Database/MySQLConnection.h index b6656d42d91..df42cd3a342 100644 --- a/src/server/database/Database/MySQLConnection.h +++ b/src/server/database/Database/MySQLConnection.h @@ -18,6 +18,7 @@ #ifndef _MYSQLCONNECTION_H #define _MYSQLCONNECTION_H +#include "AsioHacksFwd.h" #include "Define.h" #include "DatabaseEnvFwd.h" #include <memory> @@ -25,12 +26,7 @@ #include <string> #include <vector> -template <typename T> -class ProducerConsumerQueue; - -class DatabaseWorker; class MySQLPreparedStatement; -class SQLOperation; enum ConnectionFlags { @@ -81,7 +77,8 @@ class TC_DATABASE_API MySQLConnection uint32 GetLastError(); - void StartDatabaseWorkerThread(ProducerConsumerQueue<SQLOperation*>* queue); + void StartWorkerThread(Trinity::Asio::IoContext* context); + std::thread::id GetWorkerThreadId() const; protected: /// Tries to acquire lock. If lock is acquired by another thread @@ -106,7 +103,7 @@ class TC_DATABASE_API MySQLConnection private: bool _HandleMySQLErrno(uint32 errNo, uint8 attempts = 5); - std::unique_ptr<DatabaseWorker> m_worker; //!< Core worker task. + std::unique_ptr<std::thread> m_workerThread; //!< Core worker thread. MySQLHandle* m_Mysql; //!< MySQL Handle. MySQLConnectionInfo& m_connectionInfo; //!< Connection info (used for logging) ConnectionFlags m_connectionFlags; //!< Connection flags (for preparing relevant statements) |