Check arena in current context in pre_reentrancy.

This commit is contained in:
Qi Wang
2017-06-22 16:18:30 -07:00
committed by Qi Wang
parent d6eb8ac8f3
commit 425463a446
7 changed files with 51 additions and 47 deletions

View File

@@ -316,7 +316,7 @@ background_threads_disable_single(tsd_t *tsd, background_thread_info_t *info) {
&background_thread_lock);
}
pre_reentrancy(tsd);
pre_reentrancy(tsd, NULL);
malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx);
bool has_thread;
assert(info->state != background_thread_paused);
@@ -408,7 +408,7 @@ label_restart:
*/
malloc_mutex_unlock(tsd_tsdn(tsd), &background_thread_lock);
pre_reentrancy(tsd);
pre_reentrancy(tsd, NULL);
int err = background_thread_create_signals_masked(&info->thread,
NULL, background_thread_entry, (void *)(uintptr_t)i);
post_reentrancy(tsd);
@@ -557,7 +557,7 @@ background_thread_create(tsd_t *tsd, unsigned arena_ind) {
return false;
}
pre_reentrancy(tsd);
pre_reentrancy(tsd, NULL);
/*
* To avoid complications (besides reentrancy), create internal
* background threads with the underlying pthread_create.