summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-02-05 03:04:54 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-02-05 03:04:54 +0000
commit08b1c5c92869f5ac4c198ddd824fa8fce005a704 (patch)
tree2fb49a3b114ae8be952ea411c1aac6b367229dc9
parent118990614c01d4866ba79dc95d91c6151985f85e (diff)
downloadFreeBSD-src-08b1c5c92869f5ac4c198ddd824fa8fce005a704.zip
FreeBSD-src-08b1c5c92869f5ac4c198ddd824fa8fce005a704.tar.gz
Now, thread name is stored in kernel, userland no longer has to keep it.
-rw-r--r--lib/libthr/thread/thr_init.c3
-rw-r--r--lib/libthr/thread/thr_list.c5
-rw-r--r--lib/libthr/thread/thr_private.h1
3 files changed, 2 insertions, 7 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index a7ff4fc..33f3ee6 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -384,7 +384,7 @@ init_main_thread(struct pthread *thread)
thread->magic = THR_MAGIC;
thread->cancelflags = PTHREAD_CANCEL_ENABLE | PTHREAD_CANCEL_DEFERRED;
- thread->name = strdup("initial thread");
+ thr_set_name(thread->tid, "initial thread");
/* Default the priority of the initial thread: */
thread->base_priority = THR_DEFAULT_PRIORITY;
@@ -414,7 +414,6 @@ init_private(void)
_thr_umtx_init(&_thr_event_lock);
_thr_spinlock_init();
_thr_list_init();
- _thr_timer_init();
/*
* Avoid reinitializing some things if they don't need to be,
diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c
index ede90ce..072dc22 100644
--- a/lib/libthr/thread/thr_list.c
+++ b/lib/libthr/thread/thr_list.c
@@ -177,10 +177,7 @@ void
_thr_free(struct pthread *curthread, struct pthread *thread)
{
DBG_MSG("Freeing thread %p\n", thread);
- if (thread->name) {
- free(thread->name);
- thread->name = NULL;
- }
+
/*
* Always free tcb, as we only know it is part of RTLD TLS
* block, but don't know its detail and can not assume how
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
index bf10228..c922b46 100644
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -338,7 +338,6 @@ struct pthread {
*/
#define THR_MAGIC ((u_int32_t) 0xd09ba115)
u_int32_t magic;
- char *name;
/*
* Lock for accesses to this thread structure.
OpenPOWER on IntegriCloud