Only abort on dlsym when necessary.

If neither background_thread nor lazy_lock is in use, do not abort on dlsym
errors.
This commit is contained in:
Qi Wang 2017-06-14 12:12:23 -07:00 committed by Qi Wang
parent bdcf40a620
commit a4d6fe73cf
3 changed files with 19 additions and 3 deletions

View file

@ -1522,6 +1522,13 @@ background_thread_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
background_thread_enabled_set(tsd_tsdn(tsd), newval);
if (newval) {
if (!can_enable_background_thread) {
malloc_printf("<jemalloc>: Error in dlsym("
"RTLD_NEXT, \"pthread_create\"). Cannot "
"enable background_thread\n");
ret = EFAULT;
goto label_return;
}
if (background_threads_enable(tsd)) {
ret = EFAULT;
goto label_return;