summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authornathanw <nathanw@NetBSD.org>2003-02-26 23:41:01 +0000
committernathanw <nathanw@NetBSD.org>2003-02-26 23:41:01 +0000
commit508a50ac15bc8cd5f1df1ca58a887d91c06c8dbc (patch)
treeced2e49b17229ddfd85191030370beeca8542d3c /lib/libpthread
parentb9d81d9cc967c685fc7cffd350be260d134770f3 (diff)
In pthread_create(), rearrange name-setting code so that name is set
to NULL when the attribute structure does not have a private field allocated.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c
index 38686a3107e..b4674a9d44e 100644
--- a/lib/libpthread/pthread.c
+++ b/lib/libpthread/pthread.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.11 2003/02/26 22:02:48 thorpej Exp $ */
+/* $NetBSD: pthread.c,v 1.12 2003/02/26 23:41:01 nathanw Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -251,13 +251,11 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
return EINVAL;
/* Fetch misc. attributes from the attr structure. */
- if ((p = nattr.pta_private) != NULL) {
- if (p->ptap_name[0] != '\0') {
+ name = NULL;
+ if ((p = nattr.pta_private) != NULL)
+ if (p->ptap_name[0] != '\0')
if ((name = strdup(p->ptap_name)) == NULL)
return ENOMEM;
- } else
- name = NULL;
- }
self = pthread__self();
@@ -300,7 +298,7 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
nthreads++;
pthread_spinunlock(self, &pthread__allqueue_lock);
- SDPRINTF(("(pthread_create %p) Created new thread %p.\n", self, newthread));
+ SDPRINTF(("(pthread_create %p) Created new thread %p (name pointer %p).\n", self, newthread, newthread->pt_name));
/* 6. Put on run queue. */
pthread__sched(self, newthread);