提交 e5320032 编写于 作者: N Nikita Mikhaylov

fix bug with queue

上级 736b97c9
......@@ -96,6 +96,8 @@ CacheDictionary::~CacheDictionary()
{
finished = true;
update_queue.clear();
auto empty_finishing_ptr = std::make_shared<UpdateUnit>(std::vector<Key>());
update_queue.push(empty_finishing_ptr);
update_thread.join();
}
......@@ -726,6 +728,9 @@ void CacheDictionary::updateThreadFunction()
UpdateUnitPtr first_popped;
update_queue.pop(first_popped);
if (finished)
break;
/// Wait other pointers to be pushed.
/// std::this_thread::sleep_for(std::chrono::milliseconds(1000));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册