summaryrefslogtreecommitdiff
path: root/lib/libpthread/pthread.c
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2006-02-12 11:41:53 +0000
committeryamt <yamt@NetBSD.org>2006-02-12 11:41:53 +0000
commit9f9e6a32ddbf96a74c139f4e4eb0f98cd92581c3 (patch)
tree430ca2deac9f2e0d16986bcb3b1e3415f4c541ad /lib/libpthread/pthread.c
parent16b7c5d1dd780196ff3db4920921a6d44ecbc8db (diff)
- do PTHREAD_MLOCK_KLUDGE in pthread__stackid_setup, rather than callers,
so that the main thread is not different from others. as a side effect, fix memory leak in pthread_create on error. - make pthread__stackid_setup return a error rather than calling err(2).
Diffstat (limited to 'lib/libpthread/pthread.c')
-rw-r--r--lib/libpthread/pthread.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c
index 0969a57afdd..d5578fc5cbc 100644
--- a/lib/libpthread/pthread.c
+++ b/lib/libpthread/pthread.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.46 2005/10/19 02:44:45 chs Exp $ */
+/* $NetBSD: pthread.c,v 1.47 2006/02/12 11:41:53 yamt Exp $ */
/*-
* Copyright (c) 2001,2002,2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.46 2005/10/19 02:44:45 chs Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.47 2006/02/12 11:41:53 yamt Exp $");
#include <err.h>
#include <errno.h>
@@ -371,12 +371,6 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
free(name);
return ret;
}
-#ifdef PTHREAD_MLOCK_KLUDGE
- ret = mlock(newthread, sizeof(struct __pthread_st));
- if (ret < 0) {
- return EAGAIN;
- }
-#endif
}
/* 2. Set up state. */