MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / arena_reset_prepare_background_thread

Function arena_reset_prepare_background_thread

deps/jemalloc/src/ctl.c:2155–2169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2153}
2154
2155static void
2156arena_reset_prepare_background_thread(tsd_t *tsd, unsigned arena_ind) {
2157 /* Temporarily disable the background thread during arena reset. */
2158 if (have_background_thread) {
2159 malloc_mutex_lock(tsd_tsdn(tsd), &background_thread_lock);
2160 if (background_thread_enabled()) {
2161 background_thread_info_t *info =
2162 background_thread_info_get(arena_ind);
2163 assert(info->state == background_thread_started);
2164 malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx);
2165 info->state = background_thread_paused;
2166 malloc_mutex_unlock(tsd_tsdn(tsd), &info->mtx);
2167 }
2168 }
2169}
2170
2171static void
2172arena_reset_finish_background_thread(tsd_t *tsd, unsigned arena_ind) {

Callers 2

arena_i_reset_ctlFunction · 0.70
arena_i_destroy_ctlFunction · 0.70

Calls 4

malloc_mutex_lockFunction · 0.50
tsd_tsdnFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected