1 #ifndef JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H 2 #define JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H 3 4 extern bool opt_background_thread; 5 extern size_t opt_max_background_threads; 6 extern malloc_mutex_t background_thread_lock; 7 extern atomic_b_t background_thread_enabled_state; 8 extern size_t n_background_threads; 9 extern size_t max_background_threads; 10 extern background_thread_info_t *background_thread_info; 11 extern bool can_enable_background_thread; 12 13 bool background_thread_create(tsd_t *tsd, unsigned arena_ind); 14 bool background_threads_enable(tsd_t *tsd); 15 bool background_threads_disable(tsd_t *tsd); 16 void background_thread_interval_check(tsdn_t *tsdn, arena_t *arena, 17 arena_decay_t *decay, size_t npages_new); 18 void background_thread_prefork0(tsdn_t *tsdn); 19 void background_thread_prefork1(tsdn_t *tsdn); 20 void background_thread_postfork_parent(tsdn_t *tsdn); 21 void background_thread_postfork_child(tsdn_t *tsdn); 22 bool background_thread_stats_read(tsdn_t *tsdn, 23 background_thread_stats_t *stats); 24 void background_thread_ctl_init(tsdn_t *tsdn); 25 26 #ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER 27 extern int pthread_create_wrapper(pthread_t *__restrict, const pthread_attr_t *, 28 void *(*)(void *), void *__restrict); 29 #endif 30 bool background_thread_boot0(void); 31 bool background_thread_boot1(tsdn_t *tsdn); 32 33 #endif /* JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H */ 34