summaryrefslogtreecommitdiff
path: root/rts/posix/OSThreads.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/posix/OSThreads.c')
-rw-r--r--rts/posix/OSThreads.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 6c09f86c7f..481b0f8c17 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -30,7 +30,7 @@
#if defined(HAVE_PTHREAD_H)
#include <pthread.h>
-#if defined(freebsd_HOST_OS)
+#if defined(HAVE_PTHREAD_NP_H)
#include <pthread_np.h>
#endif
#endif
@@ -137,8 +137,12 @@ createOSThread (OSThreadId* pId, char *name STG_UNUSED,
int result = pthread_create(pId, NULL, startProc, param);
if (!result) {
pthread_detach(*pId);
-#if defined(HAVE_PTHREAD_SETNAME_NP)
+#if defined(HAVE_PTHREAD_SET_NAME_NP)
+ pthread_set_name_np(*pId, name);
+#elif defined(HAVE_PTHREAD_SETNAME_NP)
pthread_setname_np(*pId, name);
+#elif defined(HAVE_PTHREAD_SETNAME_NP_DARWIN)
+ pthread_setname_np(name);
#endif
}
return result;