Commit 9c2a7c66 authored by Dominik Charousset's avatar Dominik Charousset

Fix caching of sipped urgent messages, close #1171

parent 91156107
......@@ -932,16 +932,14 @@ void scheduled_actor::push_to_cache(mailbox_element_ptr ptr) {
using namespace intrusive;
auto& p = mailbox_.queue().policy();
auto& qs = mailbox_.queue().queues();
// TODO: use generic lambda to avoid code duplication when switching to C++14
if (p.id_of(*ptr) == normal_queue_index) {
auto& q = std::get<normal_queue_index>(qs);
auto push = [&ptr](auto& q) {
q.inc_total_task_size(q.policy().task_size(*ptr));
q.cache().push_back(ptr.release());
} else {
auto& q = std::get<normal_queue_index>(qs);
q.inc_total_task_size(q.policy().task_size(*ptr));
q.cache().push_back(ptr.release());
}
};
if (p.id_of(*ptr) == normal_queue_index)
push(std::get<normal_queue_index>(qs));
else
push(std::get<urgent_queue_index>(qs));
}
scheduled_actor::urgent_queue& scheduled_actor::get_urgent_queue() {
......
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