mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Shut down db connection pool (fixes #7036)
This commit is contained in:
parent
2e1157bf3f
commit
a44bd9d3e1
|
@ -160,6 +160,9 @@ void CDbConnectionPool::ExecuteWrite(
|
|||
|
||||
void CDbConnectionPool::OnShutdown()
|
||||
{
|
||||
if(m_Shutdown)
|
||||
return;
|
||||
m_Shutdown = true;
|
||||
m_pShared->m_Shutdown.store(true);
|
||||
m_pShared->m_NumBackup.Signal();
|
||||
int i = 0;
|
||||
|
@ -470,6 +473,7 @@ CDbConnectionPool::CDbConnectionPool()
|
|||
|
||||
CDbConnectionPool::~CDbConnectionPool()
|
||||
{
|
||||
OnShutdown();
|
||||
if(m_pWorkerThread)
|
||||
thread_wait(m_pWorkerThread);
|
||||
if(m_pBackupThread)
|
||||
|
|
|
@ -104,6 +104,8 @@ private:
|
|||
// where the next query is added to the queue.
|
||||
int m_InsertIdx = 0;
|
||||
|
||||
bool m_Shutdown = false;
|
||||
|
||||
struct CSharedData
|
||||
{
|
||||
// Used as signal that shutdown is in progress from main thread to
|
||||
|
|
Loading…
Reference in a new issue