aboutsummaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/background_thread_inlines.h
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-06-22 13:57:50 -0700
committerQi Wang <interwq@gmail.com>2017-06-22 16:53:58 -0700
commit52fc887b49c768a9cee61d9bda9c885efb10fe95 (patch)
tree32c31e69218c1bb350f1a2f20626172dd3340c33 /include/jemalloc/internal/background_thread_inlines.h
parent37f3fa0941022d047fdcd86959d5f94f872e45e2 (diff)
downloadplatform_external_jemalloc_new-52fc887b49c768a9cee61d9bda9c885efb10fe95.tar.gz
platform_external_jemalloc_new-52fc887b49c768a9cee61d9bda9c885efb10fe95.tar.bz2
platform_external_jemalloc_new-52fc887b49c768a9cee61d9bda9c885efb10fe95.zip
Avoid inactivity_check within background threads.
Passing is_background_thread down the decay path, so that background thread itself won't attempt inactivity_check. This fixes an issue with background thread doing trylock on a mutex it already owns.
Diffstat (limited to 'include/jemalloc/internal/background_thread_inlines.h')
-rw-r--r--include/jemalloc/internal/background_thread_inlines.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/jemalloc/internal/background_thread_inlines.h b/include/jemalloc/internal/background_thread_inlines.h
index fd5095f2..ef50231e 100644
--- a/include/jemalloc/internal/background_thread_inlines.h
+++ b/include/jemalloc/internal/background_thread_inlines.h
@@ -41,8 +41,9 @@ background_thread_indefinite_sleep(background_thread_info_t *info) {
}
JEMALLOC_ALWAYS_INLINE void
-arena_background_thread_inactivity_check(tsdn_t *tsdn, arena_t *arena) {
- if (!background_thread_enabled()) {
+arena_background_thread_inactivity_check(tsdn_t *tsdn, arena_t *arena,
+ bool is_background_thread) {
+ if (!background_thread_enabled() || is_background_thread) {
return;
}
background_thread_info_t *info =