From 852abac0c8df21b6a0ae6fd753ed9e562867247b Mon Sep 17 00:00:00 2001 From: Philip Guenthe Date: Mon, 7 Jul 2008 04:59:23 +0000 Subject: Application-specified thread stacks didn't work with libpthread because it treated the supplied memory as holding an internal data structure instead of as the stack space itself ok kurt@, "looks ok" otto@, tested on hppa by kettenis@ --- lib/libpthread/uthread/uthread_create.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/libpthread/uthread/uthread_create.c b/lib/libpthread/uthread/uthread_create.c index adeada443ae..3a5f7a626e4 100644 --- a/lib/libpthread/uthread/uthread_create.c +++ b/lib/libpthread/uthread/uthread_create.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_create.c,v 1.21 2005/01/23 19:23:47 kettenis Exp $ */ +/* $OpenBSD: uthread_create.c,v 1.22 2008/07/07 04:59:22 guenther Exp $ */ /* * Copyright (c) 1995-1998 John Birrell * All rights reserved. @@ -84,17 +84,13 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, } else { pattr = *attr; } - /* Check if a stack was specified in the thread attributes: */ - if ((stack = pattr->stackaddr_attr) != NULL) { - } + /* Allocate a stack: */ - else { - stack = _thread_stack_alloc(pattr->stackaddr_attr, - pattr->stacksize_attr); - if (stack == NULL) { - ret = EAGAIN; - free(new_thread); - } + stack = _thread_stack_alloc(pattr->stackaddr_attr, + pattr->stacksize_attr); + if (stack == NULL) { + ret = EAGAIN; + free(new_thread); } /* Check for errors: */ -- cgit v1.2.3