| 199 | } |
| 200 | |
| 201 | extent_hooks_t * |
| 202 | extent_hooks_set(tsd_t *tsd, arena_t *arena, extent_hooks_t *extent_hooks) { |
| 203 | background_thread_info_t *info; |
| 204 | if (have_background_thread) { |
| 205 | info = arena_background_thread_info_get(arena); |
| 206 | malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx); |
| 207 | } |
| 208 | extent_hooks_t *ret = base_extent_hooks_set(arena->base, extent_hooks); |
| 209 | if (have_background_thread) { |
| 210 | malloc_mutex_unlock(tsd_tsdn(tsd), &info->mtx); |
| 211 | } |
| 212 | |
| 213 | return ret; |
| 214 | } |
| 215 | |
| 216 | static void |
| 217 | extent_hooks_assure_initialized(arena_t *arena, |
no test coverage detected