aboutsummaryrefslogtreecommitdiffstats
path: root/src/background_thread.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-06-23 09:58:35 -0700
committerQi Wang <interwq@gmail.com>2017-06-23 10:54:54 -0700
commita3f4977217af417b547e34cec3f5bd16874b8aa9 (patch)
tree85c1d5f0afa1f999ccf6a10ee215ff4e33a9b329 /src/background_thread.c
parent52fc887b49c768a9cee61d9bda9c885efb10fe95 (diff)
downloadplatform_external_jemalloc_new-a3f4977217af417b547e34cec3f5bd16874b8aa9.tar.gz
platform_external_jemalloc_new-a3f4977217af417b547e34cec3f5bd16874b8aa9.tar.bz2
platform_external_jemalloc_new-a3f4977217af417b547e34cec3f5bd16874b8aa9.zip
Add thread name for background threads.
Diffstat (limited to 'src/background_thread.c')
-rw-r--r--src/background_thread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/background_thread.c b/src/background_thread.c
index f0aa04f3..ab076fee 100644
--- a/src/background_thread.c
+++ b/src/background_thread.c
@@ -499,7 +499,9 @@ static void *
background_thread_entry(void *ind_arg) {
unsigned thread_ind = (unsigned)(uintptr_t)ind_arg;
assert(thread_ind < ncpus);
-
+#ifdef JEMALLOC_HAVE_PTHREAD_SETNAME_NP
+ pthread_setname_np(pthread_self(), "jemalloc_bg_thd");
+#endif
if (opt_percpu_arena != percpu_arena_disabled) {
set_current_thread_affinity((int)thread_ind);
}