From 959f7365fccd1c89be9938c2655eba9122171e6a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 20 Oct 2013 20:35:45 +0200 Subject: Drop threadvars entirely --- pthread/pt-create.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pthread') 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); -- cgit v1.2.3