2017-03-18 03:42:33 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H
|
|
|
|
#define JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H
|
|
|
|
|
|
|
|
extern bool opt_background_thread;
|
2018-03-30 03:58:13 +08:00
|
|
|
extern size_t opt_max_background_threads;
|
2017-03-18 03:42:33 +08:00
|
|
|
extern malloc_mutex_t background_thread_lock;
|
|
|
|
extern atomic_b_t background_thread_enabled_state;
|
|
|
|
extern size_t n_background_threads;
|
2018-03-30 03:58:13 +08:00
|
|
|
extern size_t max_background_threads;
|
2017-03-18 03:42:33 +08:00
|
|
|
extern background_thread_info_t *background_thread_info;
|
|
|
|
|
|
|
|
bool background_thread_create(tsd_t *tsd, unsigned arena_ind);
|
|
|
|
bool background_threads_enable(tsd_t *tsd);
|
|
|
|
bool background_threads_disable(tsd_t *tsd);
|
2021-08-19 10:24:37 +08:00
|
|
|
bool background_thread_is_started(background_thread_info_t* info);
|
2021-08-07 05:53:05 +08:00
|
|
|
void background_thread_wakeup_early(background_thread_info_t *info,
|
|
|
|
nstime_t *remaining_sleep);
|
2017-03-18 03:42:33 +08:00
|
|
|
void background_thread_prefork0(tsdn_t *tsdn);
|
|
|
|
void background_thread_prefork1(tsdn_t *tsdn);
|
|
|
|
void background_thread_postfork_parent(tsdn_t *tsdn);
|
|
|
|
void background_thread_postfork_child(tsdn_t *tsdn);
|
2017-05-13 03:30:33 +08:00
|
|
|
bool background_thread_stats_read(tsdn_t *tsdn,
|
|
|
|
background_thread_stats_t *stats);
|
2017-06-02 03:52:09 +08:00
|
|
|
void background_thread_ctl_init(tsdn_t *tsdn);
|
2017-03-18 03:42:33 +08:00
|
|
|
|
2017-06-01 07:45:14 +08:00
|
|
|
#ifdef JEMALLOC_PTHREAD_CREATE_WRAPPER
|
|
|
|
extern int pthread_create_wrapper(pthread_t *__restrict, const pthread_attr_t *,
|
2017-03-18 03:42:33 +08:00
|
|
|
void *(*)(void *), void *__restrict);
|
|
|
|
#endif
|
2017-06-01 07:45:14 +08:00
|
|
|
bool background_thread_boot0(void);
|
2020-02-18 06:13:38 +08:00
|
|
|
bool background_thread_boot1(tsdn_t *tsdn, base_t *base);
|
2017-03-18 03:42:33 +08:00
|
|
|
|
|
|
|
#endif /* JEMALLOC_INTERNAL_BACKGROUND_THREAD_EXTERNS_H */
|