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
65a1c4a0
Commit
65a1c4a0
authored
Oct 28, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/Loop: pass SocketEvent& to AbandonFD()
parent
46418d0f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
Loop.cxx
src/event/Loop.cxx
+3
-2
Loop.hxx
src/event/Loop.hxx
+1
-1
SocketEvent.cxx
src/event/SocketEvent.cxx
+2
-2
No files found.
src/event/Loop.cxx
View file @
65a1c4a0
...
...
@@ -103,13 +103,14 @@ EventLoop::Break() noexcept
}
bool
EventLoop
::
AbandonFD
(
int
_fd
)
noexcept
EventLoop
::
AbandonFD
(
SocketEvent
&
event
)
noexcept
{
#ifdef HAVE_THREADED_EVENT_LOOP
assert
(
!
IsAlive
()
||
IsInside
());
#endif
assert
(
event
.
IsDefined
());
return
poll_backend
.
Abandon
(
_fd
);
return
poll_backend
.
Abandon
(
event
.
GetSocket
().
Get
()
);
}
bool
...
...
src/event/Loop.hxx
View file @
65a1c4a0
...
...
@@ -196,7 +196,7 @@ public:
* has been closed. This is like RemoveFD(), but does not
* attempt to use #EPOLL_CTL_DEL.
*/
bool
AbandonFD
(
int
fd
)
noexcept
;
bool
AbandonFD
(
SocketEvent
&
event
)
noexcept
;
void
AddIdle
(
IdleEvent
&
i
)
noexcept
;
...
...
src/event/SocketEvent.cxx
View file @
65a1c4a0
...
...
@@ -44,7 +44,7 @@ SocketEvent::Close() noexcept
return
;
if
(
std
::
exchange
(
scheduled_flags
,
0
)
!=
0
)
loop
.
AbandonFD
(
fd
.
Get
()
);
loop
.
AbandonFD
(
*
this
);
fd
.
Close
();
}
...
...
@@ -52,7 +52,7 @@ void
SocketEvent
::
Abandon
()
noexcept
{
if
(
std
::
exchange
(
scheduled_flags
,
0
)
!=
0
)
loop
.
AbandonFD
(
fd
.
Get
()
);
loop
.
AbandonFD
(
*
this
);
fd
=
SocketDescriptor
::
Undefined
();
}
...
...
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