1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
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:
Ulrich Drepper
2007-08-21 23:55:36 +00:00
parent 45dc3ad77e
commit 2a01ce56b7
4 changed files with 118 additions and 1 deletions

View File

@ -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;
}
}
}
}