mirror of
https://github.com/Pithikos/C-Thread-Pool
synced 2024-11-23 14:09:37 +03:00
Merge Lambda0x00 master
This commit is contained in:
commit
8c9e0ea8d7
5
thpool.c
5
thpool.c
@ -28,6 +28,9 @@
|
|||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "thpool.h"
|
#include "thpool.h"
|
||||||
|
|
||||||
@ -342,6 +345,8 @@ static void* thread_do(struct thread* thread_p){
|
|||||||
prctl(PR_SET_NAME, thread_name);
|
prctl(PR_SET_NAME, thread_name);
|
||||||
#elif defined(__APPLE__) && defined(__MACH__)
|
#elif defined(__APPLE__) && defined(__MACH__)
|
||||||
pthread_setname_np(thread_name);
|
pthread_setname_np(thread_name);
|
||||||
|
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||||
|
pthread_set_name_np(thread_p->pthread, thread_name);
|
||||||
#else
|
#else
|
||||||
err("thread_do(): pthread_setname_np is not supported on this system");
|
err("thread_do(): pthread_setname_np is not supported on this system");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user