33 std::unique_lock<std::mutex> lock(
mutex_);
35 for (request_queue_map::iterator i =
queues_.begin(); i !=
queues_.end(); i++)
41 std::unique_lock<std::mutex> lock(
mutex_);
45 request_queue_map::iterator qi =
queues_.find(queue_id);
50 #if FOXXLL_HAVE_LINUXAIO_FILE 51 if (
const linuxaio_file* af =
52 dynamic_cast<const linuxaio_file*>(file)) {
53 queues_[queue_id] =
new linuxaio_queue(af->get_desired_queue_length());
62 std::unique_lock<std::mutex> lock(
mutex_);
64 #ifdef FOXXLL_HACK_SINGLE_IO_THREAD 67 request_queue_map::iterator qi =
queues_.find(disk);
72 #if FOXXLL_HAVE_LINUXAIO_FILE 73 if (dynamic_cast<linuxaio_request*>(req.
get()))
74 q =
queues_[disk] =
new linuxaio_queue(
75 dynamic_cast<linuxaio_file*>(req->get_file())->get_desired_queue_length()
89 std::unique_lock<std::mutex> lock(
mutex_);
91 #ifdef FOXXLL_HACK_SINGLE_IO_THREAD 102 std::unique_lock<std::mutex> lock(
mutex_);
112 std::unique_lock<std::mutex> lock(
mutex_);
114 for (request_queue_map::iterator i =
queues_.begin(); i !=
queues_.end(); i++)
115 i->second->set_priority_op(op);
Interface of a request_queue to which requests can be added and canceled.
virtual void add_request(request_ptr &req)=0
request_queue_map queues_
virtual int get_queue_id() const =0
Type * get() const noexcept
return the enclosed pointer.
void make_queue(file *file)
static instance_pointer get_instance()
return instance or create base instance if empty
High-performance smart pointer used as a wrapping reference counting pointer.
void set_priority_op(const request_queue::priority_op &op)
void add_request(request_ptr &req, disk_id_type disk)
request_queue * get_queue(disk_id_type disk)
bool cancel_request(request_ptr &req, disk_id_type disk)