aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-28 11:31:37 +0100
committerMax Kellermann <max@duempel.org>2014-01-28 11:33:15 +0100
commit2f873edc9c61a55c7a524a48f16cb197cd08b37d (patch)
treecabb774125289d6c2d8998d919079fa73c3738be /src/thread
parentd5f46a846adaa9e881c91fddaad78369b1abc2e5 (diff)
downloadmpd-2f873edc9c61a55c7a524a48f16cb197cd08b37d.tar.gz
mpd-2f873edc9c61a55c7a524a48f16cb197cd08b37d.tar.xz
mpd-2f873edc9c61a55c7a524a48f16cb197cd08b37d.zip
thread/Name: implementation for Mac OS X
pthread_setname_np() doesn't have the "thread" argument on OS X.
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/Name.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread/Name.hxx b/src/thread/Name.hxx
index a6faa0508..f86fc6e42 100644
--- a/src/thread/Name.hxx
+++ b/src/thread/Name.hxx
@@ -29,7 +29,11 @@ static inline void
SetThreadName(const char *name)
{
#ifdef HAVE_PTHREAD_SETNAME_NP
+#ifdef __APPLE__
+ pthread_setname_np(name);
+#else
pthread_setname_np(pthread_self(), name);
+#endif
#else
(void)name;
#endif