diff options
author | Max Kellermann <max@musicpd.org> | 2017-02-10 22:41:11 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-01-07 17:20:26 +0100 |
commit | 8649ea3d6fcbad110ecb668b8485cf4b8b45caba (patch) | |
tree | 0ad6948c8f77286aea01d524a2ca16220983139b /src/output | |
parent | 752ff12c37741d7b2bc52619529dabb59e91a998 (diff) |
thread/Thread: use BoundMethod
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/Init.cxx | 3 | ||||
-rw-r--r-- | src/output/Internal.hxx | 1 | ||||
-rw-r--r-- | src/output/OutputThread.cxx | 11 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/output/Init.cxx b/src/output/Init.cxx index 453200dc9..34b53d916 100644 --- a/src/output/Init.cxx +++ b/src/output/Init.cxx @@ -51,7 +51,8 @@ AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin, const ConfigBlock &block) - :plugin(_plugin) + :plugin(_plugin), + thread(BIND_THIS_METHOD(Task)) { assert(plugin.finish != nullptr); assert(plugin.open != nullptr); diff --git a/src/output/Internal.hxx b/src/output/Internal.hxx index 75355e8b9..4d23b8232 100644 --- a/src/output/Internal.hxx +++ b/src/output/Internal.hxx @@ -515,7 +515,6 @@ private: * The OutputThread. */ void Task(); - static void Task(void *arg); }; /** diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index d3f9c2bb8..91d61f576 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -396,7 +396,7 @@ AudioOutput::Pause() pause = false; } -inline void +void AudioOutput::Task() { FormatThreadName("output:%s", name); @@ -513,16 +513,9 @@ AudioOutput::Task() } void -AudioOutput::Task(void *arg) -{ - AudioOutput *ao = (AudioOutput *)arg; - ao->Task(); -} - -void AudioOutput::StartThread() { assert(command == Command::NONE); - thread.Start(Task, this); + thread.Start(); } |