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
eda06993
Commit
eda06993
authored
Feb 09, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/MultiSocketMonitor: add method Reset()
parent
4b30ef1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
9 deletions
+26
-9
MultiSocketMonitor.cxx
src/event/MultiSocketMonitor.cxx
+8
-2
MultiSocketMonitor.hxx
src/event/MultiSocketMonitor.hxx
+17
-2
AlsaInputPlugin.cxx
src/input/plugins/AlsaInputPlugin.cxx
+1
-5
No files found.
src/event/MultiSocketMonitor.cxx
View file @
eda06993
...
...
@@ -31,9 +31,15 @@ MultiSocketMonitor::MultiSocketMonitor(EventLoop &_loop)
:
IdleMonitor
(
_loop
),
TimeoutMonitor
(
_loop
)
{
}
MultiSocketMonitor
::~
MultiSocketMonitor
()
void
MultiSocketMonitor
::
Reset
()
{
// TODO
assert
(
GetEventLoop
().
IsInsideOrNull
());
fds
.
clear
();
IdleMonitor
::
Cancel
();
TimeoutMonitor
::
Cancel
();
ready
=
refresh
=
false
;
}
void
...
...
src/event/MultiSocketMonitor.hxx
View file @
eda06993
...
...
@@ -119,11 +119,26 @@ public:
static
constexpr
unsigned
HANGUP
=
SocketMonitor
::
HANGUP
;
MultiSocketMonitor
(
EventLoop
&
_loop
);
~
MultiSocketMonitor
();
using
IdleMonitor
::
GetEventLoop
;
public
:
/**
* Clear the socket list and disable all #EventLoop
* registrations. Run this in the #EventLoop thread before
* destroying this object.
*
* Later, this object can be reused and reactivated by calling
* InvalidateSockets().
*
* Note that this class doesn't have a destructor which calls
* this method, because this would be racy and thus pointless:
* at the time ~MultiSocketMonitor() is called, our virtual
* methods have been morphed to be pure again, and in the
* meantime the #EventLoop thread could invoke those pure
* methods.
*/
void
Reset
();
/**
* Invalidate the socket list. A call to PrepareSockets() is
* scheduled which will then update the list.
...
...
src/input/plugins/AlsaInputPlugin.cxx
View file @
eda06993
...
...
@@ -98,12 +98,8 @@ public:
}
~
AlsaInputStream
()
{
/* ClearSocketList must be called from within the
IOThread; if we don't do it manually here, the
~MultiSocketMonitor() will do it in the current
thread */
BlockingCall
(
MultiSocketMonitor
::
GetEventLoop
(),
[
this
](){
ClearSocketLis
t
();
MultiSocketMonitor
::
Rese
t
();
});
snd_pcm_close
(
capture_handle
);
...
...
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