diff options
author | 2008-07-07 04:59:22 +0000 | |
---|---|---|
committer | 2008-07-07 04:59:22 +0000 | |
commit | d869e6d06d94c8ce7e890a3ff6e8cde37c252fb6 (patch) | |
tree | 18e61b7bfc0dddf9d5fca970ed5165434eaa584c /lib/libpthread/uthread | |
parent | tweak the alignment of the rx buffers so the headers in the frame are (diff) | |
download | wireguard-openbsd-d869e6d06d94c8ce7e890a3ff6e8cde37c252fb6.tar.xz wireguard-openbsd-d869e6d06d94c8ce7e890a3ff6e8cde37c252fb6.zip |
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: */ |