feat(Core/Threading): replace ace threading (#4821)

This commit is contained in:
Kargatum
2021-04-17 00:45:29 +07:00
committed by GitHub
parent b9e84d8278
commit b2861be1cd
50 changed files with 300 additions and 342 deletions

View File

@@ -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;