Drop high rank locks when creating threads.

Avoid holding arenas_lock and background_thread_lock when creating background
threads, because pthread_create may take internal locks, and potentially cause
deadlock with jemalloc internal locks.
This commit is contained in:
Qi Wang
2017-06-07 15:49:09 -07:00
committed by Qi Wang
parent 00869e39a3
commit 73713fbb27
5 changed files with 43 additions and 13 deletions

View File

@@ -15,6 +15,7 @@ extern percpu_arena_mode_t opt_percpu_arena;
extern const char *percpu_arena_mode_names[];
extern const uint64_t h_steps[SMOOTHSTEP_NSTEPS];
extern malloc_mutex_t arenas_lock;
void arena_stats_large_nrequests_add(tsdn_t *tsdn, arena_stats_t *arena_stats,
szind_t szind, uint64_t nrequests);