Skip to content

Commit 8c9e0ea

Browse files
committed
Merge Lambda0x00 master
2 parents 9577c67 + 29e85fe commit 8c9e0ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

thpool.c

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#if defined(__linux__)
2929
#include <sys/prctl.h>
3030
#endif
31+
#if defined(__FreeBSD__) || defined(__OpenBSD__)
32+
#include <pthread_np.h>
33+
#endif
3134

3235
#include "thpool.h"
3336

@@ -342,6 +345,8 @@ static void* thread_do(struct thread* thread_p){
342345
prctl(PR_SET_NAME, thread_name);
343346
#elif defined(__APPLE__) && defined(__MACH__)
344347
pthread_setname_np(thread_name);
348+
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
349+
pthread_set_name_np(thread_p->pthread, thread_name);
345350
#else
346351
err("thread_do(): pthread_setname_np is not supported on this system");
347352
#endif

0 commit comments

Comments
 (0)