diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2008-07-07 04:59:23 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2008-07-07 04:59:23 +0000 |
commit | 852abac0c8df21b6a0ae6fd753ed9e562867247b (patch) | |
tree | a2641702139382a1caa37d3e7073d2334cdb0bb6 /lib/libpthread/uthread | |
parent | a7cb196aee24adfb6a4fe78e540bba0925bd26ee (diff) |
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@
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r-- | lib/libpthread/uthread/uthread_create.c | 18 |
1 files 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 <jb@cimlogic.com.au> * 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: */ |