Fix background thread index issues with max_background_threads.

This commit is contained in:
Qi Wang
2018-05-11 16:32:29 -07:00
committed by Qi Wang
parent e8a63b87c3
commit 312352faa8
3 changed files with 10 additions and 7 deletions

View File

@@ -142,7 +142,7 @@ do_arena_reset_post(void **ptrs, unsigned nptrs, unsigned arena_ind) {
if (have_background_thread) {
malloc_mutex_lock(tsdn,
&background_thread_info[arena_ind % ncpus].mtx);
&background_thread_info_get(arena_ind)->mtx);
}
/* Verify allocations no longer exist. */
for (i = 0; i < nptrs; i++) {
@@ -151,7 +151,7 @@ do_arena_reset_post(void **ptrs, unsigned nptrs, unsigned arena_ind) {
}
if (have_background_thread) {
malloc_mutex_unlock(tsdn,
&background_thread_info[arena_ind % ncpus].mtx);
&background_thread_info_get(arena_ind)->mtx);
}
free(ptrs);