Make use of pthread_set_name_np(3) on FreeBSD.
This commit is contained in:
parent
936bc2aa15
commit
ceba1dde27
@ -31,6 +31,9 @@
|
|||||||
# include <sys/uio.h>
|
# include <sys/uio.h>
|
||||||
# endif
|
# endif
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
|
# ifdef __FreeBSD__
|
||||||
|
# include <pthread_np.h>
|
||||||
|
# endif
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
# ifdef JEMALLOC_OS_UNFAIR_LOCK
|
# ifdef JEMALLOC_OS_UNFAIR_LOCK
|
||||||
# include <os/lock.h>
|
# include <os/lock.h>
|
||||||
|
@ -509,6 +509,8 @@ background_thread_entry(void *ind_arg) {
|
|||||||
assert(thread_ind < max_background_threads);
|
assert(thread_ind < max_background_threads);
|
||||||
#ifdef JEMALLOC_HAVE_PTHREAD_SETNAME_NP
|
#ifdef JEMALLOC_HAVE_PTHREAD_SETNAME_NP
|
||||||
pthread_setname_np(pthread_self(), "jemalloc_bg_thd");
|
pthread_setname_np(pthread_self(), "jemalloc_bg_thd");
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
pthread_set_name_np(pthread_self(), "jemalloc_bg_thd");
|
||||||
#endif
|
#endif
|
||||||
if (opt_percpu_arena != percpu_arena_disabled) {
|
if (opt_percpu_arena != percpu_arena_disabled) {
|
||||||
set_current_thread_affinity((int)thread_ind);
|
set_current_thread_affinity((int)thread_ind);
|
||||||
|
Loading…
Reference in New Issue
Block a user