We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9577c67 + 29e85fe commit 8c9e0eaCopy full SHA for 8c9e0ea
thpool.c
@@ -28,6 +28,9 @@
28
#if defined(__linux__)
29
#include <sys/prctl.h>
30
#endif
31
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
32
+#include <pthread_np.h>
33
+#endif
34
35
#include "thpool.h"
36
@@ -342,6 +345,8 @@ static void* thread_do(struct thread* thread_p){
342
345
prctl(PR_SET_NAME, thread_name);
343
346
#elif defined(__APPLE__) && defined(__MACH__)
344
347
pthread_setname_np(thread_name);
348
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
349
+ pthread_set_name_np(thread_p->pthread, thread_name);
350
#else
351
err("thread_do(): pthread_setname_np is not supported on this system");
352
0 commit comments