From: Avner BenHanoch Date: Sun, 6 Mar 2016 09:00:28 +0000 (+0200) Subject: msg: remove duplicated code - local_delivery will now call 'enqueue' X-Git-Tag: v10.1.0~197^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7948%2Fhead;p=ceph.git msg: remove duplicated code - local_delivery will now call 'enqueue' This simplify the code and clarify that for each local message, 'local_delivery_thread' simply tries to 'fast_dispatch' it, or it will 'enqueue' it for the dispatch_thread (like any standard message) Signed-off-by: Avner BenHanoch --- diff --git a/src/msg/simple/DispatchQueue.cc b/src/msg/simple/DispatchQueue.cc index 6f7495ef5201..fed198e49849 100644 --- a/src/msg/simple/DispatchQueue.cc +++ b/src/msg/simple/DispatchQueue.cc @@ -123,16 +123,7 @@ void DispatchQueue::run_local_delivery() if (can_fast_dispatch(m)) { fast_dispatch(m); } else { - Mutex::Locker l(lock); - add_arrival(m); - if (priority >= CEPH_MSG_PRIO_LOW) { - mqueue.enqueue_strict( - 0, priority, QueueItem(m)); - } else { - mqueue.enqueue( - 0, priority, m->get_cost(), QueueItem(m)); - } - cond.Signal(); + enqueue(m, priority, 0); } local_delivery_lock.Lock(); }