Shut down db connection pool (fixes #7036)

This commit is contained in:
Dennis Felsing 2023-08-17 14:35:58 +02:00
parent 2e1157bf3f
commit a44bd9d3e1
2 changed files with 6 additions and 0 deletions

View file

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

View file

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