mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-17 08:01:49 +03:00
Move background thread creation to background_thread_0.
To avoid complications, avoid invoking pthread_create "internally", instead rely on thread0 to launch new threads, and also terminating threads when asked.
This commit is contained in:
parent
13685ab1b7
commit
464cb60490
4 changed files with 313 additions and 208 deletions
|
|
@ -10,8 +10,6 @@ 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);
|
||||
bool background_threads_disable_single(tsd_t *tsd,
|
||||
background_thread_info_t *info);
|
||||
void background_thread_interval_check(tsdn_t *tsdn, arena_t *arena,
|
||||
arena_decay_t *decay, size_t npages_new);
|
||||
void background_thread_prefork0(tsdn_t *tsdn);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ struct background_thread_info_s {
|
|||
malloc_mutex_t mtx;
|
||||
/* Whether the thread has been created. */
|
||||
bool started;
|
||||
/* Pause execution (for arena reset / destroy). */
|
||||
bool pause;
|
||||
/* When true, it means no wakeup scheduled. */
|
||||
atomic_b_t indefinite_sleep;
|
||||
/* Next scheduled wakeup time (absolute time in ns). */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue