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
b06c4e27
Commit
b06c4e27
authored
Oct 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/{Idle,Defer}Event: use base_hook instead of member_hook
Allows forward declaration.
parent
1686f4e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
16 deletions
+10
-16
DeferEvent.hxx
src/event/DeferEvent.hxx
+4
-5
IdleEvent.hxx
src/event/IdleEvent.hxx
+4
-5
Loop.hxx
src/event/Loop.hxx
+2
-6
No files found.
src/event/DeferEvent.hxx
View file @
b06c4e27
...
...
@@ -31,12 +31,11 @@ class EventLoop;
*
* This class is thread-safe.
*/
class
DeferEvent
final
{
class
DeferEvent
final
:
public
boost
::
intrusive
::
list_base_hook
<>
{
friend
class
EventLoop
;
typedef
boost
::
intrusive
::
list_member_hook
<>
ListHook
;
ListHook
list_hook
;
EventLoop
&
loop
;
typedef
BoundMethod
<
void
()
noexcept
>
Callback
;
...
...
@@ -59,7 +58,7 @@ public:
private
:
bool
IsPending
()
const
noexcept
{
return
list_hook
.
is_linked
();
return
is_linked
();
}
void
RunDeferred
()
noexcept
{
...
...
src/event/IdleEvent.hxx
View file @
b06c4e27
...
...
@@ -34,12 +34,11 @@ class EventLoop;
* thread that runs the #EventLoop, except where explicitly documented
* as thread-safe.
*/
class
IdleEvent
{
class
IdleEvent
:
public
boost
::
intrusive
::
list_base_hook
<>
{
friend
class
EventLoop
;
using
ListHook
=
boost
::
intrusive
::
list_member_hook
<>
;
ListHook
list_hook
;
EventLoop
&
loop
;
using
Callback
=
BoundMethod
<
void
()
noexcept
>
;
...
...
@@ -63,7 +62,7 @@ public:
}
bool
IsActive
()
const
noexcept
{
return
list_hook
.
is_linked
();
return
is_linked
();
}
void
Schedule
()
noexcept
;
...
...
src/event/Loop.hxx
View file @
b06c4e27
...
...
@@ -72,9 +72,7 @@ class EventLoop final : SocketMonitor
using
IdleList
=
boost
::
intrusive
::
list
<
IdleEvent
,
boost
::
intrusive
::
member_hook
<
IdleEvent
,
IdleEvent
::
ListHook
,
&
IdleEvent
::
list_hook
>
,
boost
::
intrusive
::
base_hook
<
boost
::
intrusive
::
list_base_hook
<>>
,
boost
::
intrusive
::
constant_time_size
<
false
>>
;
IdleList
idle
;
...
...
@@ -82,9 +80,7 @@ class EventLoop final : SocketMonitor
using
DeferredList
=
boost
::
intrusive
::
list
<
DeferEvent
,
boost
::
intrusive
::
member_hook
<
DeferEvent
,
DeferEvent
::
ListHook
,
&
DeferEvent
::
list_hook
>
,
boost
::
intrusive
::
base_hook
<
boost
::
intrusive
::
list_base_hook
<>>
,
boost
::
intrusive
::
constant_time_size
<
false
>>
;
DeferredList
deferred
;
...
...
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