summaryrefslogtreecommitdiff
path: root/pthread
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-20 20:35:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-20 20:35:45 +0200
commit959f7365fccd1c89be9938c2655eba9122171e6a (patch)
treee6bfd2033e25a1ff84c4ed38dc6e2f3084ff3c71 /pthread
parente0e1f05656e0b443bcb4a5c61550925acba78cb6 (diff)
Drop threadvars entirely
Diffstat (limited to 'pthread')
-rw-r--r--pthread/pt-create.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c
index a593ad0..723aa81 100644
--- a/pthread/pt-create.c
+++ b/pthread/pt-create.c
@@ -114,11 +114,12 @@ __pthread_create_internal (struct __pthread **thread,
/* Find a stack. There are several scenarios: if a detached thread
kills itself, it has no way to deallocate its stack, thus it
leaves PTHREAD->stack set to true. We try to reuse it here,
- however, if the user supplied a stack, we cannot use the old one.
- Right now, we simply deallocate it. */
+ however, if the user supplied a stack or changes the size,
+ we cannot use the old one. Right now, we simply deallocate it. */
if (pthread->stack)
{
- if (setup->stackaddr != __pthread_default_attr.stackaddr)
+ if ((setup->stackaddr && setup->stackaddr != pthread->stackaddr)
+ || (setup->stacksize != pthread->stacksize))
{
__pthread_stack_dealloc (pthread->stackaddr,
pthread->stacksize);