1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-1810 Fix hang on low core count

Anything that links against joblist will spin up a threadpool upon
startup. This includes the tools setConfig/getConfig. It is possible on
a low core count machine or low CPU speed that the signal to the prune
thread to shutdown is sent before the thread has completed startup when
these quick-running tools are used.

This fix adds a mutex so that spin up and shutdown can't happen at the
same time as well as a stop watch in case we are shutting down when
either the thread is running or we haven't fully started.
This commit is contained in:
Andrew Hutchings
2018-10-16 17:55:41 +01:00
parent 788139f3ad
commit de19208ea9
2 changed files with 5 additions and 0 deletions

View File

@ -357,6 +357,7 @@ private:
std::string fName; // Optional to add a name to the pool for debugging.
bool fDebug;
boost::mutex fInitMutex;
boost::mutex fPruneMutex;
boost::condition fPruneThreadEnd;
boost::thread* fPruneThread;