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
7e1b5348
Commit
7e1b5348
authored
Dec 14, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/MultipleOutputs: parallelize EnableDisable()
parent
6425b4f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
Internal.hxx
src/output/Internal.hxx
+8
-8
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+8
-1
OutputControl.cxx
src/output/OutputControl.cxx
+4
-4
No files found.
src/output/Internal.hxx
View file @
7e1b5348
...
...
@@ -323,34 +323,34 @@ public:
void
LockCommandWait
(
Command
cmd
);
/**
* Enables the device.
* Enables the device
, but don't wait for completion
.
*
* Caller must lock the mutex.
*/
void
Enable
Wait
();
void
Enable
Async
();
/**
* Disables the device.
* Disables the device
, but don't wait for completion
.
*
* Caller must lock the mutex.
*/
void
Disable
Wait
();
void
Disable
Async
();
/**
* Attempt to enable or disable the device as specified by the
* #enabled attribute; attempt to sync it with #really_enabled
* (wrapper for Enable
Wait() or DisableWait
()).
* (wrapper for Enable
Async() or DisableAsync
()).
*
* Caller must lock the mutex.
*/
void
EnableDisable
Wait
()
{
void
EnableDisable
Async
()
{
if
(
enabled
==
really_enabled
)
return
;
if
(
enabled
)
Enable
Wait
();
Enable
Async
();
else
Disable
Wait
();
Disable
Async
();
}
void
LockPauseAsync
();
...
...
src/output/MultipleOutputs.cxx
View file @
7e1b5348
...
...
@@ -107,9 +107,16 @@ MultipleOutputs::FindByName(const char *name) const
void
MultipleOutputs
::
EnableDisable
()
{
/* parallel execution */
for
(
auto
ao
:
outputs
)
{
const
ScopeLock
lock
(
ao
->
mutex
);
ao
->
EnableDisableAsync
();
}
for
(
auto
ao
:
outputs
)
{
const
ScopeLock
lock
(
ao
->
mutex
);
ao
->
EnableDisableWait
();
ao
->
WaitForCommand
();
}
}
...
...
src/output/OutputControl.cxx
View file @
7e1b5348
...
...
@@ -70,7 +70,7 @@ AudioOutput::LockCommandWait(Command cmd)
}
void
AudioOutput
::
Enable
Wait
()
AudioOutput
::
Enable
Async
()
{
if
(
!
thread
.
IsDefined
())
{
if
(
plugin
.
enable
==
nullptr
)
{
...
...
@@ -84,11 +84,11 @@ AudioOutput::EnableWait()
StartThread
();
}
Command
Wait
(
Command
::
ENABLE
);
Command
Async
(
Command
::
ENABLE
);
}
void
AudioOutput
::
Disable
Wait
()
AudioOutput
::
Disable
Async
()
{
if
(
!
thread
.
IsDefined
())
{
if
(
plugin
.
disable
==
nullptr
)
...
...
@@ -101,7 +101,7 @@ AudioOutput::DisableWait()
return
;
}
Command
Wait
(
Command
::
DISABLE
);
Command
Async
(
Command
::
DISABLE
);
}
inline
bool
...
...
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