Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
#define dout_subsys ceph_subsys_rgw
bool RGWAsyncRadosProcessor::RGWWQ::_enqueue(RGWAsyncRadosRequest *req) {
+ if (processor->is_going_down()) {
+ return false;
+ }
req->get();
processor->m_req_queue.push_back(req);
dout(20) << "enqueued request req=" << hex << req << dec << dendl;
}
void RGWAsyncRadosProcessor::stop() {
+ going_down.set(1);
m_tp.drain(&req_wq);
m_tp.stop();
for (auto iter = m_req_queue.begin(); iter != m_req_queue.end(); ++iter) {
class RGWAsyncRadosProcessor {
deque<RGWAsyncRadosRequest *> m_req_queue;
+ atomic_t going_down;
protected:
RGWRados *store;
ThreadPool m_tp;
void stop();
void handle_request(RGWAsyncRadosRequest *req);
void queue(RGWAsyncRadosRequest *req);
+
+ bool is_going_down() {
+ return (going_down.read() != 0);
+ }
};