Commit ba3354fc authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-28995 Sporadic Assertion on shutdown in threadpool_winsockets.cc

Remove the affected assert.
Wait for all AIO_buffer_cache::release_buffer() to finish before
AIO_buffer_cache::clear().
parent 90792e4a
...@@ -114,8 +114,17 @@ void AIO_buffer_cache::clear() ...@@ -114,8 +114,17 @@ void AIO_buffer_cache::clear()
if (!m_base) if (!m_base)
return; return;
/* Check that all items are returned to the cache. */ std::unique_lock<std::mutex> lk(m_mtx, std::defer_lock);
DBUG_ASSERT(m_cache.size() == m_elements); for(;;)
{
if (lk.try_lock())
{
if (m_cache.size() == m_elements)
break;
lk.unlock();
}
Sleep(100);
}
VirtualFree(m_base, 0, MEM_RELEASE); VirtualFree(m_base, 0, MEM_RELEASE);
m_cache.clear(); m_cache.clear();
m_base= 0; m_base= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment