Skip to content
Permalink
Browse files

Fix setThreadName support for BSD

  • Loading branch information...
ShadowNinja committed May 26, 2014
1 parent 7fba341 commit 31f9912e9e9f0d970725788af27f3a731415a57d
Showing with 8 additions and 1 deletion.
  1. +8 −1 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 <pthread.h>
#include <pthread_np.h>

inline void setThreadName(const char *name) {
pthread_set_name_np(pthread_self(), name);
}
#elif defined(__NetBSD__)
#include <pthread.h>

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

0 comments on commit 31f9912

Please sign in to comment.
You can’t perform that action at this time.