io/uring/Queue: use IntrusiveList<>
This commit is contained in:
parent
f64799622d
commit
3ac87bbcda
|
@ -33,16 +33,14 @@
|
|||
#pragma once
|
||||
|
||||
#include "Operation.hxx"
|
||||
|
||||
#include <boost/intrusive/list_hook.hpp>
|
||||
#include "util/IntrusiveList.hxx"
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
namespace Uring {
|
||||
|
||||
class CancellableOperation
|
||||
: public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>
|
||||
class CancellableOperation : public IntrusiveListHook
|
||||
{
|
||||
Operation *operation;
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ Queue::DispatchOneCompletion(struct io_uring_cqe &cqe) noexcept
|
|||
if (data != nullptr) {
|
||||
auto *c = (CancellableOperation *)data;
|
||||
c->OnUringCompletion(cqe.res);
|
||||
operations.erase_and_dispose(operations.iterator_to(*c),
|
||||
DeleteDisposer{});
|
||||
c->unlink();
|
||||
delete c;
|
||||
}
|
||||
|
||||
ring.SeenCompletion(cqe);
|
||||
|
|
|
@ -33,11 +33,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "Ring.hxx"
|
||||
#include "util/IntrusiveList.hxx"
|
||||
|
||||
#include <liburing.h>
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
namespace Uring {
|
||||
|
||||
class Operation;
|
||||
|
@ -50,9 +49,7 @@ class CancellableOperation;
|
|||
class Queue {
|
||||
Ring ring;
|
||||
|
||||
boost::intrusive::list<CancellableOperation,
|
||||
boost::intrusive::base_hook<boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>>,
|
||||
boost::intrusive::constant_time_size<false>> operations;
|
||||
IntrusiveList<CancellableOperation> operations;
|
||||
|
||||
public:
|
||||
Queue(unsigned entries, unsigned flags);
|
||||
|
|
Loading…
Reference in New Issue