Force purge on thread death only when w/o bg thds.

This commit is contained in:
Qi Wang 2019-01-11 11:22:11 -08:00 committed by Qi Wang
parent fc13a7f1fa
commit 0ecd5addb1

View File

@ -527,8 +527,8 @@ tcache_destroy(tsd_t *tsd, tcache_t *tcache, bool tsd_tcache) {
arena_decay(tsd_tsdn(tsd), arena_get(tsd_tsdn(tsd), 0, false), arena_decay(tsd_tsdn(tsd), arena_get(tsd_tsdn(tsd), 0, false),
false, false); false, false);
unsigned nthreads = arena_nthreads_get(arena, false); if (arena_nthreads_get(arena, false) == 0 &&
if (nthreads == 0) { !background_thread_enabled()) {
/* Force purging when no threads assigned to the arena anymore. */ /* Force purging when no threads assigned to the arena anymore. */
arena_decay(tsd_tsdn(tsd), arena, false, true); arena_decay(tsd_tsdn(tsd), arena, false, true);
} else { } else {