clickhouse: removed a very unlikely race condition on loading Dictionaries [#CONV-6318].

This commit is contained in:
Michael Kolupaev 2012-12-20 12:58:47 +00:00
parent c89bac439a
commit 57fccc9387

View File

@ -69,10 +69,10 @@ private:
{
while (true)
{
reloadImpl();
if (destroy.tryWait(reload_period * 1000))
return;
reloadImpl();
}
}
@ -80,9 +80,10 @@ public:
/// Справочники будут обновляться в отдельном потоке, каждые reload_period секунд.
Dictionaries(int reload_period_ = 3600)
: reload_period(reload_period_),
reloading_thread(&Dictionaries::reloadPeriodically, this),
log(&Logger::get("Dictionaries"))
{
reloadImpl();
reloading_thread = boost::thread(&Dictionaries::reloadPeriodically, this);
}
~Dictionaries()