From 31f9912e9e9f0d970725788af27f3a731415a57d Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Mon, 26 May 2014 15:17:59 -0400 Subject: [PATCH] Fix setThreadName support for BSD --- src/porting.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/porting.h b/src/porting.h index 90bfa250..937ca946 100644 --- a/src/porting.h +++ b/src/porting.h @@ -285,12 +285,19 @@ inline u32 getTime(TimePrecision prec) */ prctl(PR_SET_NAME, name); } -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #include + #include inline void setThreadName(const char *name) { pthread_set_name_np(pthread_self(), name); } +#elif defined(__NetBSD__) + #include + + inline void setThreadName(const char *name) { + pthread_setname_np(pthread_self(), name); + } #elif defined(_MSC_VER) typedef struct tagTHREADNAME_INFO { DWORD dwType; // must be 0x1000 -- 2.30.2