}
return m_items.front();
}
- void requeue(T *item) {
+ void requeue_front(T *item) {
std::lock_guard pool_locker(m_pool->_lock);
_void_process_finish(nullptr);
m_items.push_front(item);
}
+ void requeue_back(T *item) {
+ std::lock_guard pool_locker(m_pool->_lock);
+ _void_process_finish(nullptr);
+ m_items.push_back(item);
+ }
void signal() {
std::lock_guard pool_locker(m_pool->_lock);
m_pool->_cond.notify_one();
ceph_assert(m_io_throttled.load() > 0);
item->set_throttled(flag);
if (item->were_all_throttled()) {
- this->requeue(item);
+ this->requeue_front(item);
--m_io_throttled;
this->signal();
}
} else {
// since IO was stalled for acquire -- original IO order is preserved
// if we requeue this op for work queue processing
- this->requeue(req);
+ this->requeue_front(req);
}
ceph_assert(m_io_blockers.load() > 0);
} else {
// since IO was stalled for refresh -- original IO order is preserved
// if we requeue this op for work queue processing
- this->requeue(req);
+ this->requeue_front(req);
}
ceph_assert(m_io_blockers.load() > 0);
MOCK_METHOD0(process_finish, void());
MOCK_METHOD0(front, ImageDispatchSpec*());
- MOCK_METHOD1(requeue, void(ImageDispatchSpec*));
+ MOCK_METHOD1(requeue_front, void(ImageDispatchSpec*));
MOCK_METHOD0(dequeue, void*());
MOCK_METHOD1(queue, void(ImageDispatchSpec*));
EXPECT_CALL(image_request_wq, queue(_));
}
- void expect_requeue(MockImageRequestWQ &image_request_wq) {
- EXPECT_CALL(image_request_wq, requeue(_));
+ void expect_requeue_front(MockImageRequestWQ &image_request_wq) {
+ EXPECT_CALL(image_request_wq, requeue_front(_));
}
void expect_front(MockImageRequestWQ &image_request_wq,
expect_tokens_requested(mock_queued_image_request, 2, true);
expect_dequeue(mock_image_request_wq, &mock_queued_image_request);
expect_all_throttled(mock_queued_image_request, true);
- expect_requeue(mock_image_request_wq);
+ expect_requeue_front(mock_image_request_wq);
expect_signal(mock_image_request_wq);
ASSERT_TRUE(mock_image_request_wq.invoke_dequeue() == nullptr);
}
expect_tokens_requested(mock_queued_image_request, 2, true);
expect_dequeue(mock_image_request_wq, &mock_queued_image_request);
expect_all_throttled(mock_queued_image_request, true);
- expect_requeue(mock_image_request_wq);
+ expect_requeue_front(mock_image_request_wq);
expect_signal(mock_image_request_wq);
ASSERT_TRUE(mock_image_request_wq.invoke_dequeue() == nullptr);
}