summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-06-09 05:46:31 (GMT)
committerQi Wang <interwq@gmail.com>2017-06-12 15:56:14 (GMT)
commit464cb60490efda800625b16fedd5bcd238e1526e (patch)
treecf9a1798be2a035bbe1e735c16cb056f0abc1666 /include
parent13685ab1b767091d817cb4959d24a42447a6fb78 (diff)
downloadjemalloc-464cb60490efda800625b16fedd5bcd238e1526e.zip
jemalloc-464cb60490efda800625b16fedd5bcd238e1526e.tar.gz
jemalloc-464cb60490efda800625b16fedd5bcd238e1526e.tar.bz2
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.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/background_thread_externs.h2
-rw-r--r--include/jemalloc/internal/background_thread_structs.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/jemalloc/internal/background_thread_externs.h b/include/jemalloc/internal/background_thread_externs.h
index aef1c90..7c88369 100644
--- a/include/jemalloc/internal/background_thread_externs.h
+++ b/include/jemalloc/internal/background_thread_externs.h
@@ -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);
diff --git a/include/jemalloc/internal/background_thread_structs.h b/include/jemalloc/internal/background_thread_structs.h
index edf90fe..f6ad4ad 100644
--- a/include/jemalloc/internal/background_thread_structs.h
+++ b/include/jemalloc/internal/background_thread_structs.h
@@ -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). */