thread/Name: implementation for Mac OS X

pthread_setname_np() doesn't have the "thread" argument on OS X.
This commit is contained in:
Max Kellermann 2014-01-28 11:31:37 +01:00
parent d5f46a846a
commit 2f873edc9c
1 changed files with 4 additions and 0 deletions

View File

@ -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