Fix arenas_cache_cleanup().

Fix arenas_cache_cleanup() to handle allocation/deallocation within the
application's thread-specific data cleanup functions even after
arenas_cache is torn down.
This commit is contained in:
Christopher Ferris
2015-08-21 12:23:06 -07:00
committed by Jason Evans
parent b5c2a347d7
commit 45e9f66c28
3 changed files with 15 additions and 2 deletions

View File

@@ -56,9 +56,14 @@ static void *
thd_start(void *arg)
{
data_t d = (data_t)(uintptr_t)arg;
void *p;
assert_x_eq(*data_tsd_get(), DATA_INIT,
"Initial tsd get should return initialization value");
p = malloc(1);
assert_ptr_not_null(p, "Unexpected malloc() failure");
data_tsd_set(&d);
assert_x_eq(*data_tsd_get(), d,
"After tsd set, tsd get should return value that was set");
@@ -67,6 +72,7 @@ thd_start(void *arg)
assert_x_eq(*data_tsd_get(), (data_t)(uintptr_t)arg,
"Resetting local data should have no effect on tsd");
free(p);
return (NULL);
}