aboutsummaryrefslogtreecommitdiff
path: root/dep/jemalloc/src/background_thread.c
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-10-27 17:42:15 +0100
committerjackpoz <giacomopoz@gmail.com>2019-10-27 18:07:05 +0100
commit89cb584780aa936f9353fc8a2acd009c49461134 (patch)
tree542726038d4669680b9e88c0c44e939571b937f3 /dep/jemalloc/src/background_thread.c
parent267bdde3232566e210659df47dc7580e676e9ee5 (diff)
Dep/Jemalloc: Update to Jemalloc 5.2.1
Diffstat (limited to 'dep/jemalloc/src/background_thread.c')
-rw-r--r--dep/jemalloc/src/background_thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dep/jemalloc/src/background_thread.c b/dep/jemalloc/src/background_thread.c
index 5ed6c1c959b..57b9b256bb9 100644
--- a/dep/jemalloc/src/background_thread.c
+++ b/dep/jemalloc/src/background_thread.c
@@ -799,7 +799,13 @@ background_thread_stats_read(tsdn_t *tsdn, background_thread_stats_t *stats) {
nstime_init(&stats->run_interval, 0);
for (unsigned i = 0; i < max_background_threads; i++) {
background_thread_info_t *info = &background_thread_info[i];
- malloc_mutex_lock(tsdn, &info->mtx);
+ if (malloc_mutex_trylock(tsdn, &info->mtx)) {
+ /*
+ * Each background thread run may take a long time;
+ * avoid waiting on the stats if the thread is active.
+ */
+ continue;
+ }
if (info->state != background_thread_stopped) {
num_runs += info->tot_n_runs;
nstime_add(&stats->run_interval, &info->tot_sleep_time);