summaryrefslogtreecommitdiffstats
path: root/src/background_thread.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-06-07 23:12:50 (GMT)
committerQi Wang <interwq@gmail.com>2017-06-08 17:02:18 (GMT)
commit5642f03cae54eb8798dc4fa5ea28d9569572c1af (patch)
tree1aba5f85db4c5cfc18205b551f7031fdcc3a11f0 /src/background_thread.c
parent73713fbb27cd1cf6754259b19a960e91a16c3638 (diff)
downloadjemalloc-5642f03cae54eb8798dc4fa5ea28d9569572c1af.zip
jemalloc-5642f03cae54eb8798dc4fa5ea28d9569572c1af.tar.gz
jemalloc-5642f03cae54eb8798dc4fa5ea28d9569572c1af.tar.bz2
Add internal tsd for background_thread.
Diffstat (limited to 'src/background_thread.c')
-rw-r--r--src/background_thread.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/background_thread.c b/src/background_thread.c
index 50812c3..190fa2f 100644
--- a/src/background_thread.c
+++ b/src/background_thread.c
@@ -316,12 +316,11 @@ background_thread_entry(void *ind_arg) {
set_current_thread_affinity((int)thread_ind);
}
/*
- * Start periodic background work. We avoid fetching tsd to keep the
- * background thread "outside", since there may be side effects, for
- * example triggering new arena creation (which in turn triggers
- * background thread creation).
+ * Start periodic background work. We use internal tsd which avoids
+ * side effects, for example triggering new arena creation (which in
+ * turn triggers another background thread creation).
*/
- background_work(TSDN_NULL, thread_ind);
+ background_work(tsd_tsdn(tsd_internal_fetch()), thread_ind);
assert(pthread_equal(pthread_self(),
background_thread_info[thread_ind].thread));