mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Make use of pthread_set_name_np(3) on FreeBSD.
This commit is contained in:
parent
936bc2aa15
commit
ceba1dde27
2 changed files with 5 additions and 0 deletions
|
|
@ -31,6 +31,9 @@
|
|||
# include <sys/uio.h>
|
||||
# endif
|
||||
# include <pthread.h>
|
||||
# ifdef __FreeBSD__
|
||||
# include <pthread_np.h>
|
||||
# endif
|
||||
# include <signal.h>
|
||||
# ifdef JEMALLOC_OS_UNFAIR_LOCK
|
||||
# include <os/lock.h>
|
||||
|
|
|
|||
|
|
@ -509,6 +509,8 @@ background_thread_entry(void *ind_arg) {
|
|||
assert(thread_ind < max_background_threads);
|
||||
#ifdef JEMALLOC_HAVE_PTHREAD_SETNAME_NP
|
||||
pthread_setname_np(pthread_self(), "jemalloc_bg_thd");
|
||||
#elif defined(__FreeBSD__)
|
||||
pthread_set_name_np(pthread_self(), "jemalloc_bg_thd");
|
||||
#endif
|
||||
if (opt_percpu_arena != percpu_arena_disabled) {
|
||||
set_current_thread_affinity((int)thread_ind);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue