Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3ac87bbc
Commit
3ac87bbc
authored
Sep 25, 2020
by
Max Kellermann
Committed by
Max Kellermann
Oct 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
io/uring/Queue: use IntrusiveList<>
parent
f6479962
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
11 deletions
+6
-11
CancellableOperation.hxx
src/io/uring/CancellableOperation.hxx
+2
-4
Queue.cxx
src/io/uring/Queue.cxx
+2
-2
Queue.hxx
src/io/uring/Queue.hxx
+2
-5
No files found.
src/io/uring/CancellableOperation.hxx
View file @
3ac87bbc
...
...
@@ -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
;
...
...
src/io/uring/Queue.cxx
View file @
3ac87bbc
...
...
@@ -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
);
...
...
src/io/uring/Queue.hxx
View file @
3ac87bbc
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment