Make tsd no-cleanup during tsd reincarnation.

Since tsd cleanup isn't guaranteed when reincarnated, we set up tsd in a way
that needs no cleanup, by making it going through slow path instead.
This commit is contained in:
Qi Wang
2017-06-06 21:44:39 -07:00
committed by Qi Wang
parent 29c2577ee0
commit 00869e39a3
4 changed files with 51 additions and 24 deletions

View File

@@ -106,8 +106,8 @@ thd_start_reincarnated(void *arg) {
"TSD state should be reincarnated\n");
p = mallocx(1, MALLOCX_TCACHE_NONE);
assert_ptr_not_null(p, "Unexpected malloc() failure");
assert_ptr_not_null(*tsd_arenap_get_unsafe(tsd),
"Should have tsd arena set after reincarnation.");
assert_ptr_null(*tsd_arenap_get_unsafe(tsd),
"Should not have tsd arena set after reincarnation.");
free(p);
tsd_cleanup((void *)tsd);