mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
[BZ #4938]
2007-08-21 Ulrich Drepper <drepper@redhat.com> [BZ #4938] * allocatestack.c (__reclaim_stacks): Clear the TSD in the reclaimed stack if necessary. * Makefile (tests): Add tst-tsd6. * tst-tsd6.c: New file.
This commit is contained in:
@ -794,6 +794,26 @@ __reclaim_stacks (void)
|
||||
|
||||
/* Account for the size of the stack. */
|
||||
stack_cache_actsize += curp->stackblock_size;
|
||||
|
||||
if (curp->specific_used)
|
||||
{
|
||||
/* Clear the thread-specific data. */
|
||||
memset (curp->specific_1stblock, '\0',
|
||||
sizeof (curp->specific_1stblock));
|
||||
|
||||
curp->specific_used = false;
|
||||
|
||||
for (size_t cnt = 1; cnt < PTHREAD_KEY_1STLEVEL_SIZE; ++cnt)
|
||||
if (curp->specific[cnt] != NULL)
|
||||
{
|
||||
memset (curp->specific[cnt], '\0',
|
||||
sizeof (curp->specific_1stblock));
|
||||
|
||||
/* We have allocated the block which we do not
|
||||
free here so re-set the bit. */
|
||||
curp->specific_used = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user