summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-06-08 17:35:11 +0000
committerdeischen <deischen@FreeBSD.org>2003-06-08 17:35:11 +0000
commit08f5ae21798662f49079405699e6a7a9257175b4 (patch)
treee2f59ae805fe33406bc26075d32f8eea7414ed07 /lib/libpthread
parent49fd6082dc00a29d428e37d6172c9c7e7ec381af (diff)
downloadFreeBSD-src-08f5ae21798662f49079405699e6a7a9257175b4.zip
FreeBSD-src-08f5ae21798662f49079405699e6a7a9257175b4.tar.gz
Insert threads at the end of the free thread list so that
the chance of getting the same thread id when allocating a new thread is reduced. This won't work if the application creates a new thread for every time a thread exits, but we're still within the allowances of POSIX.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_kern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c
index 365d799..71957cf 100644
--- a/lib/libpthread/thread/thr_kern.c
+++ b/lib/libpthread/thread/thr_kern.c
@@ -2151,7 +2151,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread)
else {
crit = _kse_critical_enter();
KSE_LOCK_ACQUIRE(curthread->kse, &thread_lock);
- TAILQ_INSERT_HEAD(&free_threadq, thread, tle);
+ TAILQ_INSERT_TAIL(&free_threadq, thread, tle);
free_thread_count++;
KSE_LOCK_RELEASE(curthread->kse, &thread_lock);
_kse_critical_leave(crit);
OpenPOWER on IntegriCloud