aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2018-04-18 11:30:03 -0700
committerQi Wang <interwq@gmail.com>2018-04-18 14:17:08 -0700
commitb8f4c730eff28edee4b583ff5b6ee1fac0f26c27 (patch)
treef39777bbbf941a8d617b38b367adcfd7b3db1775 /src
parentdedfeecc4e69545efb2974ae42589985ed420821 (diff)
downloadplatform_external_jemalloc_new-b8f4c730eff28edee4b583ff5b6ee1fac0f26c27.tar.gz
platform_external_jemalloc_new-b8f4c730eff28edee4b583ff5b6ee1fac0f26c27.tar.bz2
platform_external_jemalloc_new-b8f4c730eff28edee4b583ff5b6ee1fac0f26c27.zip
Remove an incorrect assertion.
Background threads are created without holding the global background_thread lock, which mean paused state is possible (and fine).
Diffstat (limited to 'src')
-rw-r--r--src/background_thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/background_thread.c b/src/background_thread.c
index 9656e196..3517a3bb 100644
--- a/src/background_thread.c
+++ b/src/background_thread.c
@@ -398,7 +398,10 @@ check_background_thread_creation(tsd_t *tsd, unsigned *n_created,
}
background_thread_info_t *info = &background_thread_info[i];
malloc_mutex_lock(tsdn, &info->mtx);
- assert(info->state != background_thread_paused);
+ /*
+ * In case of the background_thread_paused state because of
+ * arena reset, delay the creation.
+ */
bool create = (info->state == background_thread_started);
malloc_mutex_unlock(tsdn, &info->mtx);
if (!create) {