aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-23 10:07:14 +0100
committerMax Kellermann <max@duempel.org>2014-01-23 10:07:14 +0100
commitec41d849bbc460d4002ae19e3891b3bda513307e (patch)
tree21c08a38ecd7de939af5fcd08afce9b595fa897c /src/DecoderThread.cxx
parent1d547fe273b094e073ed1ad1b96df59ace4380f3 (diff)
downloadmpd-ec41d849bbc460d4002ae19e3891b3bda513307e.tar.gz
mpd-ec41d849bbc460d4002ae19e3891b3bda513307e.tar.xz
mpd-ec41d849bbc460d4002ae19e3891b3bda513307e.zip
thread/Name: set thread names
For debugging.
Diffstat (limited to 'src/DecoderThread.cxx')
-rw-r--r--src/DecoderThread.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx
index 8658c8883..5c0e31034 100644
--- a/src/DecoderThread.cxx
+++ b/src/DecoderThread.cxx
@@ -34,6 +34,7 @@
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
+#include "thread/Name.hxx"
#include "tag/ApeReplayGain.hxx"
#include "Log.hxx"
@@ -127,8 +128,12 @@ decoder_stream_decode(const DecoderPlugin &plugin,
decoder.dc.Unlock();
+ FormatThreadName("decoder:%s", plugin.name);
+
plugin.StreamDecode(decoder, input_stream);
+ SetThreadName("decoder");
+
decoder.dc.Lock();
assert(decoder.dc.state == DecoderState::START ||
@@ -155,8 +160,12 @@ decoder_file_decode(const DecoderPlugin &plugin,
decoder.dc.Unlock();
+ FormatThreadName("decoder:%s", plugin.name);
+
plugin.FileDecode(decoder, path);
+ SetThreadName("decoder");
+
decoder.dc.Lock();
assert(decoder.dc.state == DecoderState::START ||
@@ -421,6 +430,8 @@ decoder_task(void *arg)
{
DecoderControl &dc = *(DecoderControl *)arg;
+ SetThreadName("decoder");
+
dc.Lock();
do {