| 2153 | } |
| 2154 | |
| 2155 | static void |
| 2156 | arena_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 | |
| 2171 | static void |
| 2172 | arena_reset_finish_background_thread(tsd_t *tsd, unsigned arena_ind) { |
no test coverage detected