mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-20206 : Crash inside timer_callback()[threadpool_win.cc:419]
The most likely cause of the crash is that a timer fired, after it was closed. MSDN documents such a possibility, in the documentation for CloseThreadpoolTimer() function, and recommends disabling the timer before calling WaitForThreadpoolTimerCallbacks()/CloseThreadpoolTimer(). The fix follows this recommendation. Note, that 5.5-10.1 disabled the timer before close, but this code was lost in threadpool refactoring in 10.2
This commit is contained in:
@@ -308,6 +308,7 @@ TP_connection_win::~TP_connection_win()
|
||||
|
||||
if (timer)
|
||||
{
|
||||
SetThreadpoolTimer(timer, 0, 0, 0);
|
||||
WaitForThreadpoolTimerCallbacks(timer, TRUE);
|
||||
CloseThreadpoolTimer(timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user