summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_create.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-04-18 07:09:43 +0000
committerdeischen <deischen@FreeBSD.org>2003-04-18 07:09:43 +0000
commitd729efd111ee19870b3bb070e86f12c4057aa3b1 (patch)
treec4540fbdb5dd93853283bd4d70315482a539912b /lib/libpthread/thread/thr_create.c
parent556bb64555ef5aede171c8ea3372a6c814dd324d (diff)
downloadFreeBSD-src-d729efd111ee19870b3bb070e86f12c4057aa3b1.zip
FreeBSD-src-d729efd111ee19870b3bb070e86f12c4057aa3b1.tar.gz
Sorry folks; I accidentally committed a patch from what I was working
on a couple of days ago. This should be the most recent changes. Noticed by: davidxu
Diffstat (limited to 'lib/libpthread/thread/thr_create.c')
-rw-r--r--lib/libpthread/thread/thr_create.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c
index 5a435ca..74cb134 100644
--- a/lib/libpthread/thread/thr_create.c
+++ b/lib/libpthread/thread/thr_create.c
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2003 Daniel M. Eischen <deischen@gdeb.com>
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
*
@@ -107,7 +108,7 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
curkse = curthread->kse;
/* Allocate memory for the thread structure: */
- if ((new_thread = _thr_alloc(curkse)) == NULL) {
+ if ((new_thread = _thr_alloc(curthread)) == NULL) {
/* Insufficient memory to create a thread: */
ret = EAGAIN;
} else {
@@ -124,21 +125,21 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
if (create_stack(&new_thread->attr) != 0) {
/* Insufficient memory to create a stack: */
ret = EAGAIN;
- _thr_free(curkse, new_thread);
+ _thr_free(curthread, new_thread);
}
else if (((new_thread->attr.flags & PTHREAD_SCOPE_SYSTEM) != 0) &&
- (((kse = _kse_alloc(curkse)) == NULL)
- || ((kseg = _kseg_alloc(curkse)) == NULL))) {
+ (((kse = _kse_alloc(curthread)) == NULL)
+ || ((kseg = _kseg_alloc(curthread)) == NULL))) {
/* Insufficient memory to create a new KSE/KSEG: */
ret = EAGAIN;
if (kse != NULL)
- _kse_free(curkse, kse);
+ _kse_free(curthread, kse);
if ((new_thread->attr.flags & THR_STACK_USER) == 0) {
KSE_LOCK_ACQUIRE(curkse, &_thread_list_lock);
_thr_stack_free(&new_thread->attr);
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
}
- _thr_free(curkse, new_thread);
+ _thr_free(curthread, new_thread);
}
else {
if (kseg != NULL) {
OpenPOWER on IntegriCloud