From 2f873edc9c61a55c7a524a48f16cb197cd08b37d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 28 Jan 2014 11:31:37 +0100 Subject: [PATCH] thread/Name: implementation for Mac OS X pthread_setname_np() doesn't have the "thread" argument on OS X. --- src/thread/Name.hxx | 4 ++++ 1 file changed, 4 insertions(+) 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