mirror of
https://github.com/Pithikos/C-Thread-Pool
synced 2024-11-25 23:09:36 +03:00
Merge branch 'master' of github.com:lambda0x00/C-Thread-Pool into lambda0x00-master
This commit is contained in:
commit
a4cdd6976a
4
thpool.c
4
thpool.c
@ -24,6 +24,8 @@
|
||||
#include <time.h>
|
||||
#if defined(__linux__)
|
||||
#include <sys/prctl.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#include "thpool.h"
|
||||
@ -339,6 +341,8 @@ static void* thread_do(struct thread* thread_p){
|
||||
prctl(PR_SET_NAME, thread_name);
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
pthread_setname_np(thread_name);
|
||||
#elif defined(__FreeBSD__)
|
||||
pthread_set_name_np(pthread_self(), thread_name);
|
||||
#else
|
||||
err("thread_do(): pthread_setname_np is not supported on this system");
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user