Fix arena_bind().

When tsd is not in nominal state (e.g. during thread termination), we
should not increment nthreads.
This commit is contained in:
Qi Wang 2016-09-22 09:13:45 -07:00 committed by Jason Evans
parent 9ebbfca93f
commit 57ed894f8a

View File

@ -455,15 +455,16 @@ arena_bind(tsd_t *tsd, unsigned ind, bool internal)
{ {
arena_t *arena; arena_t *arena;
if (!tsd_nominal(tsd))
return;
arena = arena_get(tsd_tsdn(tsd), ind, false); arena = arena_get(tsd_tsdn(tsd), ind, false);
arena_nthreads_inc(arena, internal); arena_nthreads_inc(arena, internal);
if (tsd_nominal(tsd)) { if (internal)
if (internal) tsd_iarena_set(tsd, arena);
tsd_iarena_set(tsd, arena); else
else tsd_arena_set(tsd, arena);
tsd_arena_set(tsd, arena);
}
} }
void void